RunTask.SetArguments
--------------------

Sets the command arguments that should be used to launch the executable.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [RunTask](component_RunTask.md) | [3.1](newinversion31.md) | ✅ Yes | ✅ Yes | ❌ No | ✅ Yes, on macOS and Windows | ❌ No |

### Deprecated

This function was [deprecated](deprecated.md). Use [Shell](component_Shell.md) functions instead.

MBS( "RunTask.SetArguments"; Arguments... ) 

**MBS**( **"RunTask.SetArguments";** /\* Sets the command arguments that should be used to launch the executable. \*/  
**$Arguments...**) /\* Pass one parameter for each argument.e.g. "-v" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Arguments... | Pass one parameter for each argument. | "-v" |

### Result

Returns OK or error.

### Description

Sets the command arguments that should be used to launch the executable.  
Be aware that shell expansion does not happen and shell variables are not expanded.  
  
This function takes variable number of parameters. Pass as much parameters as needed separated by the semicolon in FileMaker.  
Please repeat Arguments parameter as often as you need.  
### Examples

Set three arguments

 MBS ( "RunTask.SetArguments"; "-v"; "-s"; "test.txt" )  
Set a lot of arguments:

 MBS ("RunTask.SetArguments"; "-i"; "/test/tmp/filetmp%d.jpg"; "-b:v"; "320k"; "-vcodec"; "prores"; "-profile"; "2"; "-qscale"; "5"; "/test/tmp/IM\_0001.mov")  
List connected clients on FileMaker Server:

 # © 30.07 .2016 Patrick Weh | Team Nifty GmbH (17:40 Uhr)   
\# List connected Clients   
\# ------------------------------------------------------------------------------------------------------------   
\# Script checks for connected clients at the FileMaker Server.   
\# Copy this File to your Server and run this Script on your FileMaker Server.   
\# ------------------------------------------------------------------------------------------------------------   
\#   
Set Error Capture \[On\]  
Allow User Abort \[Off\]  
\#   
Set Variable \[$r ; Value:MBS ( "[RunTask.NewTask](RunTaskNewTask.md)" )\]  
Set Variable \[$r ; Value:MBS ( "[RunTask.SetLaunchPath](RunTaskSetLaunchPath.md)"; "/Library/FileMaker Server/Database Server/bin/fmsadmin" )\]  
\# please put your admin password here   
Set Variable \[$r ; Value:MBS ( "RunTask.SetArguments"; "-u" ; "fmserveradmin" ; "-p" ; "fmserveradminpassword" ; "list" ; "clients" ; "-s" )\]  
Set Variable \[$r ; Value:MBS ( "[RunTask.Launch](RunTaskLaunch.md)")\]  
\# now wait for task to finish:   
Set Variable \[$result ; Value:""\]  
Loop  
 Pause/Resume Script \[Duration (seconds): 2\]  
 Set Variable \[$result ; Value:$result &amp; MBS ("[RunTask.ReadOutputText](RunTaskReadOutputText.md)")\]  
 Exit Loop If \[MBS ("[RunTask.IsRunning](RunTaskIsRunning.md)") ≠ 1\]  
End Loop  
\#   
\# write into a field:   
Set Field \[Check clients::Clients ; $result \]  
Commit Records/Requests \[No dialog\]  
\#   
Set parameters for -p "Hello World":

 MBS ( "RunTask.SetArguments"; "-p"; "Hello World" )  
  
\# please notice that we just have quotes around Hello World   
Show quicklook preview window for PDF file:

 Set Variable \[ $r ; Value: MBS ( "[RunTask.NewTask](RunTaskNewTask.md)" ) \]   
Set Variable \[ $r ; Value: MBS ( "[RunTask.SetLaunchPath](RunTaskSetLaunchPath.md)"; "/usr/bin/qlmanage" ) \]   
Set Variable \[ $r ; Value: MBS ( "RunTask.SetArguments"; "-p"; "/Users/cs/Desktop/Hello World.pdf" ) \]   
Set Variable \[ $r ; Value: MBS ( "[RunTask.Launch](RunTaskLaunch.md)") \]  
### See also

- [RunTask.AddArgument](RunTaskAddArgument.md)
- [RunTask.GetArgument](RunTaskGetArgument.md)
- [RunTask.IsRunning](RunTaskIsRunning.md)
- [RunTask.Launch](RunTaskLaunch.md)
- [RunTask.NewTask](RunTaskNewTask.md)
- [RunTask.ReadErrorText](RunTaskReadErrorText.md)
- [RunTask.ReadOutputText](RunTaskReadOutputText.md)
- [RunTask.SetLaunchPath](RunTaskSetLaunchPath.md)
- [RunTask.Wait](RunTaskWait.md)
- [URLScheme.SetDefaultHandler](URLSchemeSetDefaultHandler.md)

### Example Databases

- [Shell/RunTask/RunTask Windows](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Shell/RunTask/RunTask%20Windows.shtml#1ScriptAnchor_)
- [Shell/RunTask/RunTask](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Shell/RunTask/RunTask.shtml#1ScriptAnchor_)

### Blog Entries

- [Tip of the day: Query connected clients on FileMaker Server by script](https://www.mbsplugins.de/archive/2016-08-17/Tip_of_the_day_Query_connected/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 5th June 2021

  
[RunTask.ReadOutputText](RunTaskReadOutputText.md) - [RunTask.SetCurrentDirectoryPath](RunTaskSetCurrentDirectoryPath.md)

[HTML Version](RunTaskSetArguments.shtml)