Jump to content

Is "Find & Replace" possible within the script possible?


This topic is 5759 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi all,

I'm about to start developing a project in FM8 that's very similar to a project I already developed in FM7. In my original project I relied heavily on global fields in a set of scripts for parsing EXIF metadata from JPEGs. I'd like to replace all of the many occurrences of those global fields with script variables. Is there any way to do a find & replace in a script?

Here's an example of what I'd like to do:

Script currently says- Set Field [shutterSpeed; Left (gMetaData; 11) & Middle (gMetaData; 14;20)]

I want script to say- Set Field [shutterSpeed; Left ($$MetaData; 11) & Middle ($MetaData; 14;20)]

The above a huge oversimplification of what I want to do, as there are about half a dozen global fields and probably around 100 occurrences of them in my script set.

One thing I thought of doing is to just rename my global fields using the variable syntax (i.e. with "$$"), which would essentially make them variables and then I could just eliminate the fields. Any thoughts on this?

I'd appreciate suggestions If anyone knows of a good way to accomplish what I want to do.

Thanks in advance!

Link to comment
Share on other sites

Not yet. I have a tool that I use for myself that does that. But it's not ready for commercial release. Sometime early next year it will.

My tool uses both the objects that FM puts on the clipboard when you copy a script or a script step, or it just plains reads it from the script and manipulates the FM UI like I did with FMrobot.

In short: it's entirely doable...

Link to comment
Share on other sites

Thanks for the reply, Wim.

Okay, so now I know it's possible but I still haven't a clue as to how to approach solving this. The main problem (at least as I see it) is that I don't know how to work with the data on the clipboard when a script is copied. (my attempts of opening it up in a text editor have failed)

Does anyone know how to do this AND be willing to part with the information? :

Link to comment
Share on other sites

This topic is 5759 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.