The Perform Script script step is used to execute another script, often called a subscript. You can specify to run any of the scripts in the current database file or a script in another FileMaker file (including files on the network). It’s even possible to have a script call multiple other subscripts, that even have subscripts of their own.
HOW IT IS USED
I've noticed this script step used in 4 major ways.
One is to call a script in another database to do something and stay in that other file.
Another is to call upon a script in another file and return the results to the original script. Now I have to say this isn’t as common as it used to be because there is no real need to do that anymore (at least in most situations). Using File References, you can do all the above without leaving your starting file or calling upon a subscript. This was not the case prior to FileMaker 7, so you may come across this script technique in newly converted FileMaker 6 solutions. It is a good idea to consolidate your scripts as much as possible and this is a great example of a place in which to do so.
Sorry about going off topic there, another common use of perform script is to create specific scripts for memory related script steps such as Page Setup or Sort Orders. These scripts can be called upon as subscripts by multiple scripts. Once again, you may come across this in newly converted FileMaker 6 solutions and it is no longer needed in FileMaker 7 and above.
Another common use is to take one big script and break it down into smaller subscripts. Sub-scripts can be easier for for minor modifications, sharing sets of scripts steps to other scripts and troubleshooting.
COOL IMPLEMENTATIONS OF IT
Script Scheduler - I wrote a database that resides on a headless server that I can connect to remotely. It has a script that runs a constant loop that checks to see what day and time it is. I then put in the ability to see if the current day / time is when I want to run a repair script on one of my administrative databases. These are general repair scripts to run on the network at key times. So basically, I have one file that can run hundreds of scripts in other files based upon a defined activation day and time.
These are typically called script robots and can be quite handy if you have a spare computer and copy of FileMaker in the office.
There is a "Perform subscripts" option that can be selected or deselected. When it is selected (which is the default), it will execute any Perform Script steps that are in that secondary script. This gives you the ability to have one script in charge of many subscripts, which in turn may have subscripts of their own.
Got To Know Factor - 10
More info about the author and FileMaker in general, contact me at firstname.lastname@example.org.
© 2007 - Dwayne Wright - dwaynewright.com
The material on this document is offered AS IS. There is NO REPRESENTATION OR WARRANTY, expressed or implied, nor does any other contributor to this document. WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc.