SendCommand
-----------

Sends a command to listening application.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Utility](component_Utility.md) | [2.0](newinversion20.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

### Deprecated

This function was [deprecated](deprecated.md). Use [CURL](component_CURL.md) functions to send or [WebHook](component_WebHook.md) functions to receive instead.

MBS( "SendCommand"; Host; Port; Parameters... ) 

**MBS**( **"SendCommand";** /\* Sends a command to listening application. \*/  
**$Host**; /\* IP or domain name of the target computer.e.g. 127.0.0.1 \*/   
**$Port**; /\* Port number to use.e.g. 9999 \*/   
**$Parameters...**) /\* Parameters to send.e.g. "RunScript" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Host | IP or domain name of the target computer. | 127.0.0.1 |
| Port | Port number to use. | 9999 |
| Parameters... | Parameters to send. | "RunScript" |

### Result

Returns function result or an error message.

### Description

Sends a command to listening application.  
Connects to a TCP Socket on some computer in the network and sends a data packet with the given parameters.  
The result is parsed and a string returned as function result. Note that all plugin error messages start with "\[MBS\]".  
See the examples for a sample project and a detailed Readme on the data format.  
  
Version 6.3 now supports passing IPv4, iPv6, or a host name.  
  
This function takes variable number of parameters. Pass as much parameters as needed separated by the semicolon in FileMaker.  
Please repeat Parameters parameter as often as you need.  
### Examples

Sends a SQL select command:

 MBS ("SendCommand"; "127.0 .0.1 "; 9999; "SQLSelect"; "SELECT \* FROM testTable")  
### Blog Entries

- [The annoyance of Non-public API usage message from App Store](https://www.mbsplugins.de/archive/2019-11-15/The_annoyance_of_Non-public_AP/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 8.3pr3](https://www.mbsplugins.de/archive/2018-06-21/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 7.3pr1](https://www.mbsplugins.de/archive/2017-06-05/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 6.3pr4](https://www.mbsplugins.de/archive/2016-06-24/MBS_FileMaker_Plugin_version_6/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 25th October 2021

  
[ScriptWorkspace.Window](ScriptWorkspaceWindow.md) - [SendMail.AddAttachmentContainer](SendMailAddAttachmentContainer.md)

[HTML Version](SendCommand.shtml)