Help

Table Of Contents
Creating and managing layouts and reports
F
ILEMAKER PRO HELP 278
19. OnLayoutExit
20. OnWindowClose
21. OnLastWindowClose
Notes
Scripts that are run by script triggers use existing privileges. Unless a script is defined to run
with full privileges, the script runs using the user’s privileges.
In Custom Web Publishing, script triggers can only be activated by a script and not by direct
user interaction. For example, if a user tabs into a field that has an OnObjectEnter script
trigger, the trigger will not activate. If a script step causes focus to move into that field, the
script trigger will activate.
Some script triggers allow for the triggering event to be canceled if the script executed by
the script trigger returns a False value. When a command or event is canceled this way, the
error code is set to 20. See
Get(LastError) function for more information. If the script
executed by the OnLastWindowClose script trigger returns a False value, then the file will
not close.
The OnFirstWindowOpen and OnWindowOpen script triggers display in the Script
Debugger when a script is set to run on file open; the OnLastWindowClose and
OnWindowClose script triggers display in the Script Debugger when a script is set to run on
file close.
Windows: Alt and Ctrl key combinations do not activate script triggers.
OS X: Command key combinations do not activate script triggers.
Related topics
Debugging scripts (FileMaker Pro Advanced)
Using the Data Viewer (FileMaker Pro Advanced)
Setting script triggers for layouts
You can set up script triggers to activate when actions are performed on a specific layout.
To add, change, or delete a script trigger for a layout:
1. Create the script that you want to trigger.
2. In Layout mode, select a layout.
3. Click Layout Setup in the layout bar.
4. In the Layout Setup dialog box, click the Script Triggers tab and double-click the event that
you want to trigger the script.
5. In the Specify Script dialog box, choose the script.
6. (Optional) To specify a script parameter, type the text you want. Or, click Edit and use the
Specify Calculation dialog box to build a more complex parameter, then click OK.
7. Click OK to close the Specify Script dialog box.
8. In the Layout Setup dialog box, select modes for the script trigger.
9. Click OK.