Search Project Mgmt
Search FileMaker Blogs
FileMaker Blog
Friday
Jul132007

FILEMAKER: Exit Script Step

From Dwayne Wright - www.dwaynewright.com

Typically, this script step is used to stop the currently running script. Normally, this script step will follow shortly after an IF or Else If script step. So this portion of the script is looking for something in particular about the FileMaker record at that moment in time and then deciding to forgo executing the remainder of the script.

If this script was called upon a previous script, that script will continue to run. This is different than the Halt script step which will have ScriptMaker stop running all together before reaching the scripts end.

Recently, the Exit script step had a new option added to it called the Script Result. When you select this option, you are greeted with the calculation dialog box. The value (text, field reference or calculation) that you place into this calculation dialog will be used when the script step is executed to return that value into memory. Then it can be used later via the Get(ScriptResult) function.

HOW IT IS USED
Once again, the Exit Script step is usually used after a script branching action by the IF script step. The most common is after the Show Message script step. That step presents the user with up to three choices in the Show Message dialog box. Many times one of those options will be a Cancel button. Cancel would normally take the user out of the script via the Exit Script step.

FYI...
Be sure that in using the Exit Script step, you do not strand the user on an unfamiliar layout or leave them in the wrong layout mode. Always make sure the user is on the layout and in the mode (Browse or Find usually) they should be in before you Exit a script.

Got To Know Factor - 6

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

Wednesday
Jul112007

Pause Script Demonstration

From Dwayne Wright - www.dwaynewright.com

In this example, we have a script that sets the counter field equal to 1, pauses a second and then increments it by 1. It does this until it hit 5 in the counter, then it will pause for the duration set by the pause time field. Then it will resume until it hits 8. Then you can continue or cancel the script by buttons found in the status area. You can also continue the script by clicking the Enter key on your keyboard.

An example file can be downloaded at ...

http://www.dwaynewright.com/blogfiles/pausescript.zip
=
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.

Tuesday
Jul102007

FILEMAKER: Pause / Resume  Script

From Dwayne Wright - www.dwaynewright.com

Works like the pause button on a VCR / DVD player, you can setup this script step to pause a current running script. Paused scripts can even be given a defined time duration before they start running again.

HOW IT IS USED
Design - To pause long scripts at a given point to check how valid they are.

Troubleshooting - To place within a long script to see where a scripting error may occur.

FYI ... Both of the two examples, in many ways, this has been replaced by the script debugger found in FileMaker Advanced.

User Data Entry - To allow the user to do data entry in the middle of a script and then continue.

Splash Pages - To show a graphic, pause, then go to a data entry screen.

Allow Externals To Catch Up - When interfacing FileMaker with other applications via a script, the external source may take some time to finish running. So you can pause the FileMaker script a few seconds/minutes to allow the external operation to complete because you need the end result of it’s operation.

You have 3 different settings for the pause script step. The first is to pause the script indefinitely. So you would need to have the user hit the enter key on their keyboard, click the continue button (found in the status area) or run the script step again (depending on the buttons action, normally toggles the pause state to resume).

The next option is to pause the script for a time frame based upon a value in a field. This means you could calculate the pause duration or use a value placed into a global field. The last option is to hard code a time duration in hours, minutes and second for the pause duration.

COOL IMPLEMENTATIONS OF IT
I once had a very long and complicated script. I needed to do some troubleshooting so I used a combination of the pause script step and the speak script step. What I did was have FileMaker speak where it was in the script, then pause. After I would hit continue, it would go on until the next speak/pause combination. I did this way back in the FileMaker 4 and FileMaker 5 days. Now I use the Script Debugger feature in FileMaker Advanced, although the debugger doesn’t talk to me.

FYI...
In many cases, if you are relying on the pause script step to control the users navigation through your solution, you will want to disallow the user the ability to abort the script (User Abort is another script step).

Got To Know Factor - 8

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

Monday
Jul092007

TERM: SCRIPT BREAKPOINT

SCRIPT BREAKPOINT

CATEGORY: Troubleshooting
CLASS: Scripting
VERSION: FileMaker Advanced (7 and higher)

In FileMaker Advanced, you can use a tool called the Script Debugger. This allows you to use various techniques to debug currently running scripts. One of the things you can do is step through a currently running script on step at a time and see how your solution reacts (or doesn’t react as the case might be). With scripts that have a large amount of steps, you may want to jump right to a particular area instead of stepping to it one step at a time.

In the Script Debugger, you create a breakpoint where the script can run to and stop. Then you can resume stepping through the script one step at a time.

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.

Page 1 ... 17 18 19 20 21