Using Script Triggers
摘要
A script trigger is a developer-defined connection between an interface event and a script used to create dynamically responsive interfaces that can perform automated tasks based on a variety of user activity. Scripts used as the action for a button or custom menu must be manually performed by a user. That may be fine for tasks that are optional or require a conscious choice, but a non-optional critical business function may be overlooked and forgotten. In some cases, it can be inefficient and nonintuitive to require a user to perform extra clicks to initiate mandatory actions in the interface. Triggers allow an interface design to include dynamically responsive layouts that connect user events to custom scripts. Use them to automatically run a script when a file is first opened, a record is loaded, or a field is modified. FileMaker has over two dozen triggers for a variety of file, layout, and object events. Some events run the assigned script prior to the completion of the user action, allowing the script to execute custom steps and determine if the event should be performed to completion. Others run after the event, allowing the script to perform follow-up tasks. This chapter introduces script triggers, covering the following topics: