Jump to content

Importing Scripts from text


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

Recommended Posts

quote:

Originally posted by spragueg:

Is there any method of importing Scripts into ScriptMaker via text files. I am creating scripts that are very repetitive and need a search & replace function to edit them in a timely manner.

Thanks,

Graham Sprague

FMP 5 allows you to import scripts from other files, but that is the best you can do.

------------------

=-=-=-=-=-=-=-=-=-=-=-=-=

Kurt Knippel

Senior Filemaker Developer

http://www.database-resources.com

mailto:[email protected]

=-=-=-=-=-=-=-=-=-=-=-=-=

Link to comment
Share on other sites

Ok, so I can't import text scripts. Fine. How about simplifying my scripts. I have 30 fields all need to be setto a certain value using an if statement.

Is there a way to use one field to hold the name of another.

Then set a value to a field containing that name. Then I could write one script only and just set the name of the field before I run the script so it can be generic.

Follow?

Any one who can help?

Thanks,

Graham

Link to comment
Share on other sites

quote:

Originally posted by spragueg:

Ok, so I can't import text scripts. Fine. How about simplifying my scripts. I have 30 fields all need to be setto a certain value using an if statement.

Is there a way to use one field to hold the name of another.

Then set a value to a field containing that name. Then I could write one script only and just set the name of the field before I run the script so it can be generic.


I would recommend the following:

Break your scripts up into as many pieces as possible. Then you can simply link those peices together into bigger scripts.

Put each of the SetFields into thier own script and such.

------------------

=-=-=-=-=-=-=-=-=-=-=-=-=

Kurt Knippel

Senior Filemaker Developer

http://www.database-resources.com

mailto:[email protected]

=-=-=-=-=-=-=-=-=-=-=-=-=

Link to comment
Share on other sites

That's what I have done. My frustration lies in that it seems I can't define a variable within a script that defines the name of a field. So my question is still unanswered...

Is there a way to use one field to hold the name of another?

Can I then set a value to a field containing that name?

Any help would be great.

Thanks,

G

Link to comment
Share on other sites

You could try this is your script:

Go to Field (the field whose name you want to capture)

Set Field (FieldCapture, Status(CurrentFieldName)

FieldCapture is just the name I used for the second field you'd need to make this happen.

If I read your post right that should accomplish what you want.

As always, I hope this helps.

[This message has been edited by WBlanchard (edited August 09, 2000).]

Link to comment
Share on other sites

The "Goto Field" step dosent alow you to specify the name of a field, only the field itself. Sothe following ...

Go to Field (the field whose name you want to capture)

...results in the intended variable field being the result returned.

I guess it can't be done.

Thanks anyway,

G

Link to comment
Share on other sites

  • 2 weeks later...

You could use a loop and Go to Field next script steps... use the Status(CurrentFieldName) function to compare the current field to the one you want, looping through with Go to Field Next until you find it, then proceeding with the rest of the script.

Awkward perhaps, but it should work.

Link to comment
Share on other sites

This topic is 7650 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.