Search Project Mgmt
Search FileMaker Blogs
FileMaker Blog
Monday
Jul092007

FILEMAKER: Perform Script

From Dwayne Wright PMP - Certified FileMaker Developer
WEB: www.dwaynewright.com
EMAIL: info@dwaynewright.com
TWITTER: dwaynewright
YOUTUBE: FileMakerThoughts

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.

FYI...
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 info@dwaynewright.com.

© 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.

Thursday
Jul052007

Modular Script Design In FileMaker

From Dwayne Wright PMP, PMI-ACP, CSM
Certified FileMaker Developer

WEB: www.dwaynewright.com
EMAIL: info@dwaynewright.com
TWITTER: dwaynewright
YOUTUBE: FileMakerThoughts

As many of you know, FileMaker solutions tend to consist of 2 or more individual tables that work together. Although you can have a worthwhile FileMaker tool that consists of only one table, a solution has considerably much more power in numbers.

You can have a script perform a different script. You can even have a script perform a script that is stored in a entirely different FileMaker file. This can make your solution much more powerful because multiple files can share script action to perform a task.

This can also be used to break down a very long and complicated script into smaller but linked subscripts. I've seen some scripts so long and complicated, it hurts the brain just to look at them. Breaking them down into subscripts may help keep your head straight when writing the script and really help when you have to troubleshoot a script.

Subscripts can also very helpful when you have one set of tasks that can be shared by many scripts. For example, let's say we have 3 things we want to do for new customers each month. The scripts could have names such as...

Mail Thank You To New Customers
Send Coupons To New Customers
Report On New Customers For The Month

In each of these scripts, we could have the Find operation or we could have one script that does the find... and all the others call that script as a sub-script!

The second option, “Send Coupons To New Customers”, you could have as a subscript in many scripts. Perhaps it can be called upon by scripts such as ...

Print Invoice (calls upon coupon subscript)
Customer Annual Inactivity Report (calls upon the coupon subscript)

Troubleshooting can be easier with multiple scripts calling upon each other in a modular fashion as well. Also if you are using FileMaker Advanced, you can copy script steps from one script to another. This means you can always consolidate your modular scripts into one larger script at a given time.

=
More info about the author and FileMaker in general, contact me at info@dwaynewright.com.

© 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.

Page 1 ... 19 20 21 22 23