Reference > Script steps reference > Control script steps > Install OnTimer Script
 

Install OnTimer Script

Runs a specified script at the specified interval.

See also 

Options 

Script lets you specify the script you want to perform.

Optional script parameter lets you specify a script parameter for the specified script.

Interval seconds is the value in seconds that the timer waits before running the script.

Compatibility 

 

Product 

Supported 

FileMaker Pro Advanced 

Yes 

FileMaker Go 

Yes 

FileMaker WebDirect 

Yes 

FileMaker Server 

No 

FileMaker Cloud products 

No 

FileMaker Data API 

No 

Custom Web Publishing 

No 

Runtime solution 

Yes 

Originated in 

FileMaker Pro 10.0

Description 

This script step installs a single timer on the active window and repeats the specified script in that window until another Install OnTimer Script step installs a timer on the window or until the window closes. You can halt an installed timer by running another Install OnTimer Script step without specifying a script or interval.

Notes 

If a script is running, any scripts associated with timers will not run until the script that is running finishes.

If the active window has an installed timer and the user or a script opens a new window, the new window inherits the timer.

Each window can have a separate timer operating at the same time. Timers continue to run even if windows are in the background or hidden. If you're using dialog windows and timers, see About window styles.

The value of the Optional script parameter option is evaluated when the timer script is performed, which could be much later than when the timer is installed. At that time, Get(ScriptParameter) will have no value, because a timer script is never started while another script is running. To specify a value for the timer script to use later, use a constant, a global field, a global (not local) variable, or a calculation using functions other than Get(ScriptParameter) in this script step's Optional script parameter option.

To run scripts on a schedule and independently of open windows, see FileMaker Server Help or FileMaker Cloud product documentation in the Product Documentation Center.

Example 1 

Uses the Install OnTimer Script step to run the Clock script once every minute.

Script: Clock OnTimer

Install OnTimer Script ["Clock"; Interval: 60]

Script: Clock

Set Field [Clock::Time; Get ( CurrentTime )]

Related topics 

Script steps reference (alphabetical list)

Script steps reference (category list)

Setting up script triggers

Using variables