RemoteControl.ClickMouse
------------------------

Moves the mouse cursor and performs a click.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [RemoteControl](component_RemoteControl.md) | [2.8](newinversion28.md) | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ❌ No |

MBS( "RemoteControl.ClickMouse"; X; Y { ; down; ButtonIndex } ) 

**MBS**( **"RemoteControl.ClickMouse";** /\* Moves the mouse cursor and performs a click. \*/  
**$X**; /\* New x position of the mouse.e.g. 500 \*/   
**$Y**; /\* New y position of the mouse.e.g. 500 \*/   
**$down**; /\* Optional; Pass 1 to press mouse button and 0 to release it. If this parameter is missing, the plugin will click and release in one step.e.g. 1 \*/   
**$ButtonIndex**) /\* Optional; Optional, pass 2 for the right mouse instead of left mouse. Or 3 for the third button.e.g. 1 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| X | New x position of the mouse. | 500 |  |
| Y | New y position of the mouse. | 500 |  |
| down | Pass 1 to press mouse button and 0 to release it. If this parameter is missing, the plugin will click and release in one step. | 1 | Optional |
| ButtonIndex | Optional, pass 2 for the right mouse instead of left mouse. Or 3 for the third button. | 1 | Optional |

### Result

Returns OK on success.

### Description

Moves the mouse cursor and performs a click.  
If x and y are both zero, the mouse is not moved.  
May fail due to limited permissions.  
  
You can use [RemoteControl.MouseX](RemoteControlMouseX.md) and [RemoteControl.MouseY](RemoteControlMouseY.md) to find current mouse position.  
  
Pressing only mouse down in a script can lock FileMaker as no further script line will run before the mouse is up again!  
### See also

- [Plugin.DisableFunction](PluginDisableFunction.md)
- [Plugin.GetFunctionParameters](PluginGetFunctionParameters.md)
- [Plugin.GetFunctionPlatforms](PluginGetFunctionPlatforms.md)
- [Plugin.LimitFunction](PluginLimitFunction.md)
- [Plugin.LockFunction](PluginLockFunction.md)
- [Plugin.UnlockFunction](PluginUnlockFunction.md)
- [RemoteControl.MouseX](RemoteControlMouseX.md)
- [RemoteControl.MouseY](RemoteControlMouseY.md)
- [RemoteControl.MoveMouse](RemoteControlMoveMouse.md)

### Release notes

- **Version 7.3**
    - Fixed [RemoteControl.ClickMouse](http://www.mbsplugins.eu/RemoteControlClickMouse.shtml) to not move mouse on Mac for 0/0 coordinate.

### Example Databases

- [RemoteControl/Move Mouse](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/RemoteControl/Move%20Mouse.shtml#4ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 7.3pr3](https://www.mbsplugins.de/archive/2017-06-21/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 6.2pr4](https://www.mbsplugins.de/archive/2016-04-15/MBS_FileMaker_Plugin_version_6/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 20th November 2020

  
[Registry.SetValue](RegistrySetValue.md) - [RemoteControl.FindWindow](RemoteControlFindWindow.md)

[HTML Version](RemoteControlClickMouse.shtml)