Schedule.StartScriptOnIdle
--------------------------

Runs a script after idle period.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Schedule](component_Schedule.md) | [5.2](newinversion52.md) | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ❌ No |

MBS( "Schedule.StartScriptOnIdle"; DelaySeconds; FileName; ScriptName { ; ScriptParameter } ) 

**MBS**( **"Schedule.StartScriptOnIdle";** /\* Runs a script after idle period. \*/  
**$DelaySeconds**; /\* The Number of Seconds to wait before running the script. Moving the mouse or using keyboard will reset the counter.e.g. 10 \*/   
**$FileName**; /\* The name of the file that contains the script to be rune.g. Get(Filename) \*/   
**$ScriptName**; /\* The exact name of the script to rune.g. "TestScript" \*/   
**$ScriptParameter**) /\* Optional; The Script Parameter to pass to the script \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| DelaySeconds | The Number of Seconds to wait before running the script. Moving the mouse or using keyboard will reset the counter. | 10 |  |
| FileName | The name of the file that contains the script to be run | Get(Filename) |  |
| ScriptName | The exact name of the script to run | "TestScript" |  |
| ScriptParameter | The Script Parameter to pass to the script |  | Optional |

### Result

Returns reference number or error.

### Description

Runs a script after idle period.  
This script is called in FileMaker whenever no user activity has been for the given amount of time.  
You can also pass a text string to the Script as a Parameter. The parameter can be retrieved by using Get(ScriptParameter) in the script that plug-in is calling.  
If script is called, the user is idle the given time period. Then once user starts working again, the count is reset and next time the user is idle again, the script can be called. So our idle schedules repeat automatically.  
  
Please use [Schedule.Release](ScheduleRelease.md) later to remove schedule from list when you don't need it anymore.   
  
Our plugin does not provide persistence. You need to schedule things in your scripts if you need them. When FileMaker quits, the plugin forgets the list of schedules.  
  
Once you have the script running, you can use [Process.IsFrontMost](ProcessIsFrontMost.md) function to check if FileMaker is in the foreground or not.  
  
  
With plugin version 6.0 or newer the script name can be a script ID number. In that case the plugin queries the script name for the given script ID. This allows to call scripts by ID and avoid problems if scripts are later renamed.  
  
Notice: FileMaker 19.2 adds a fmplugin extended privileges. If you have such an extended privileges to allow the plugin to trigger scripts, you need to grant permissions for it. If such a privilege is not defined, the plugin is allowed to trigger scripts. See FileMaker product documentation for details.  
### Examples

Run a script 10 seconds after idle is detected:

 Set Variable \[ $$IdleSchedule ; Value: MBS ("Schedule.StartScriptOnIdle"; 10; Get(FileName); "testScript"; "don't work?") \]  
### See also

- [FM.RunScriptIdle](FMRunScriptIdle.md)
- [FM.StopScriptIdle](FMStopScriptIdle.md)
- [Process.IsFrontMost](ProcessIsFrontMost.md)
- [Schedule.Release](ScheduleRelease.md)
- [Schedule.StartScriptAtTime](ScheduleStartScriptAtTime.md)

### Blog Entries

- [Logging Activities in FileMaker with MBS FileMaker Plugin](https://www.mbsplugins.de/archive/2026-03-13/Logging_Activities_in_FileMake/monkeybreadsoftware_blog_filemaker)
- [MBS Plugin Quiz](https://www.mbsplugins.de/archive/2021-04-30/MBS_Plugin_Quiz/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 20th May 2015 , last changed 4th June 2023

  
[Schedule.StartScriptAtTimeStamp](ScheduleStartScriptAtTimeStamp.md) - [SchemaChange.Changes](SchemaChangeChanges.md)

[HTML Version](ScheduleStartScriptOnIdle.shtml)