RemoteControl.InsertText
------------------------

Sends text to active window/control.

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

MBS( "RemoteControl.InsertText"; Text { ; SendKeys } ) 

**MBS**( **"RemoteControl.InsertText";** /\* Sends text to active window/control. \*/  
**$Text**; /\* The text to send.e.g. "Hello" \*/   
**$SendKeys**) /\* Optional; Pass 1 to send key events on macOS instead of inserting into textfield.  
Default is 0.e.g. 1 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Text | The text to send. | "Hello" |  |
| SendKeys | Pass 1 to send key events on macOS instead of inserting into textfield.   Default is 0. | 1 | Optional |

### Result

Returns OK or error.

### Description

Sends text to active window/control.  
Uses the API to enter unicode characters, so this should work for all text fields in FileMaker.  
  
May work from a script, but you can use our [schedule](component_Schedule.md) functions to delay delivery by running the function after a delay.  
### Examples

Send text with delay:

 Set Variable \[ $r ; Value: MBS ( "[Schedule.EvaluateAfterDelay](ScheduleEvaluateAfterDelay.md)"; 1; "MBS (\\"RemoteControl.InsertText\\"; \\"Hello\\")" ) \]   
\# script ends after this   
### See also

- [Schedule.EvaluateAfterDelay](ScheduleEvaluateAfterDelay.md)

### Release notes

- **Version 12.4**
    - Added [RemoteControl.InsertText](https://www.mbsplugins.eu/RemoteControlInsertText.shtml) function.

### Blog Entries

- [MBS FileMaker Plugin 12.4](https://www.mbsplugins.de/archive/2022-09-27/MBS_FileMaker_Plugin_124/monkeybreadsoftware_blog_filemaker)
- [Neues MBS Plugin 12.4 für Claris FileMaker](https://www.mbsplugins.de/archive/2022-09-06/Neues_MBS_Plugin_124_für_Clar/monkeybreadsoftware_blog_filemaker)
- [MBS Plugin 12.4 for Claris FileMaker](https://www.mbsplugins.de/archive/2022-09-06/MBS_Plugin_124_for_Claris_File/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 12.4pr3](https://www.mbsplugins.de/archive/2022-08-24/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 23th August 2022 , last changed 26th August 2022

  
[RemoteControl.HideCursor](RemoteControlHideCursor.md) - [RemoteControl.IsAltKeyDown](RemoteControlIsAltKeyDown.md)

[HTML Version](RemoteControlInsertText.shtml)