FM.Argument
-----------

Query an argument passed to FileMaker from command line.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [FM](component_FM.md) | [5.1](newinversion51.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "FM.Argument"; Index ) 

**MBS**( **"FM.Argument"** /\* Query an argument passed to FileMaker from command line. \*/  
**$Index**) /\* The index of the argument to retrieve. From 0 to [FM.ArgumentCount](FMArgumentCount.md)-1. e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Index | The index of the argument to retrieve. From 0 to [FM.ArgumentCount](FMArgumentCount.md)-1. | 0 |

### Result

Returns text or error.

### Description

Query an argument passed to FileMaker from command line.  
You can pass arguments to FileMaker when launching it from command line. Or on Windows pass them from a link to FileMaker on desktop or in the start menu. This way you can query argument from your scripts and react on them, e.g. decide to set more buttons visible for a debug or advanced mode.  
The arguments can include on Windows file path to a database which was opened to launch FileMaker.  
### Examples

Query all arguments:

 While(  
// setup   
\[count = MBS ( "[FM.ArgumentCount](FMArgumentCount.md)" ); index = 0; list = ""\];   
// condition  
index &lt; count ;   
// add nth argument to list  
\[ list = list &amp; MBS ( "FM.Argument"; index ) &amp; ¶; index = index + 1 \];  
// return result  
list )  
### See also

- [FM.ArgumentCount](FMArgumentCount.md)

### Example Databases

- [Utility functions/Command Line Arguments](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Utility%20functions/Command%20Line%20Arguments.shtml#1ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 5.1pr1](https://www.mbsplugins.de/archive/2015-03-16/MBS_FileMaker_Plugin_version_5/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 1st March 2015 , last changed 13th June 2021

  
[FM.AllowFileDragDrop](FMAllowFileDragDrop.md) - [FM.ArgumentCount](FMArgumentCount.md)

[HTML Version](FMArgument.shtml)