Overlay.SetMouseClickScript
---------------------------

Sets the script to run on a mouse click.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Overlay](component_Overlay.md) | [14.1](newinversion141.md) | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ❌ No |

MBS( "Overlay.SetMouseClickScript"; OverlayRef; FileName; ScriptName ) 

**MBS**( **"Overlay.SetMouseClickScript";** /\* Sets the script to run on a mouse click. \*/  
**$OverlayRef**; /\* The overlay window reference number.e.g. $overlay \*/   
**$FileName**; /\* The database file name where the script is located.e.g. "test.fmp12" \*/   
**$ScriptName**) /\* The script name.e.g. "MyScript" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| OverlayRef | The overlay window reference number. | $overlay |
| FileName | The database file name where the script is located. | "test.fmp12" |
| ScriptName | The script name. | "MyScript" |

### Result

Returns OK or error.

### Description

Sets the script to run on a mouse click.  
Triggered if the user clicks, but does not drag the window.  
  
  
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.  
### See also

- [Overlay.GetMouseClickEvaluate](OverlayGetMouseClickEvaluate.md)
- [Overlay.GetMouseClickScriptName](OverlayGetMouseClickScriptName.md)
- [Overlay.SetMouseClickEvaluate](OverlaySetMouseClickEvaluate.md)
- [Overlay.SetMouseEnterScript](OverlaySetMouseEnterScript.md)
- [Overlay.SetMouseExitScript](OverlaySetMouseExitScript.md)

### Example Databases

- [Drag and Drop/DragTest](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Drag%20and%20Drop/DragTest.shtml#11ScriptAnchor_)
- [Overlay](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Overlay.shtml#1ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 14.1pr3](https://www.mbsplugins.de/archive/2024-02-19/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 4/2025, Seite 30](https://filemaker-magazin.de/neuigkeit/4297-Appetithappen-FMM_202504)

Created 15th February 2024 , last changed 22nd February 2025

  
[Overlay.SetMouseClickEvaluate](OverlaySetMouseClickEvaluate.md) - [Overlay.SetMouseEnterEvaluate](OverlaySetMouseEnterEvaluate.md)

[HTML Version](OverlaySetMouseClickScript.shtml)