Tips & Hints - Scripting
March 5, 2012
The general links in this post may be useful.
Useful, but moreso for some Ninja script moves. Thanks!
My guess is that this ability simply doesn't exist. I'd love for there to be a way to BIND scripts to Tables in such a way that if the Table is copied then new scripts matching those bound to the original table but modified to reference the new Table are created.
Scripts "reside" in files rather than tables. A script can sometimes be made to work in many contexts by passing a script parameter to the script. Easy to look up and study in Help.
Normally "Project A" and "Project B" would be two different records or two different sets of records in the same table, not two separate tables. Using separate tables implies the need to add a new table for each new project and that won't work well in FileMaker nor is it necessary.
You can, however, refer to different tables and fields in a script if you use the following script steps and functions:
Set Field By Name---> allows you to write data to a field defined in a table occurrence and field whose names are calculated.
GetField ---> allows you to read data from a field from a table occurrence and field that is calculated
GetFieldName ---> extracts the tableoccurrence::FieldName from a specified field as text. This is a useful way to pass a tableoccurrence::Field name as a parameter to your script in such fashion that the text passed automatically updates should you use Manage | Database to alter the field's name.