Shell.Wait
----------

Waits for child process.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Shell](component_Shell.md) | [7.5](newinversion75.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No |

MBS( "Shell.Wait"; ShellRef; TimeOut ) 

**MBS**( **"Shell.Wait";** /\* Waits for child process. \*/  
**$ShellRef**; /\* The reference number from the shell.e.g. $shell \*/   
**$TimeOut**) /\* The timeout in seconds on how long to wait.e.g. 3 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| ShellRef | The reference number from the shell. | $shell |
| TimeOut | The timeout in seconds on how long to wait. | 3 |

### Result

Returns OK or error.

### Description

Waits for child process.  
This blocks FileMaker for doing anything till the app is done or timeout happens.  
  
Please use 8.2 or newer on FileMaker Cloud as Shell.Wait/[Shell.IsRunning](ShellIsRunning.md) was broken there before.  
### Examples

Wait 5 seconds or till the tool quit:

 Set Variable \[ $s ; Value: MBS ( "Shell.Wait"; $shell ; 5) \]  
### See also

- [Shell.CloseInput](ShellCloseInput.md)
- [Shell.Execute](ShellExecute.md)
- [Shell.IsRunning](ShellIsRunning.md)
- [Shell.ReadOutputText](ShellReadOutputText.md)
- [Shell.WriteInputText](ShellWriteInputText.md)

### Example Databases

- [Mac and iOS/PDFKit/PDFKit Print Documents](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20and%20iOS/PDFKit/PDFKit%20Print%20Documents.shtml#4ScriptAnchor_)
- [Shell/Shell](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Shell/Shell.shtml#1ScriptAnchor_)

### Blog Entries

- [Convert Office Files in FileMaker](https://www.mbsplugins.de/archive/2022-07-04/Convert_Office_Files_in_FileMa/monkeybreadsoftware_blog_filemaker)
- [Tip of the day: Shell Execute as one Let statement](https://www.mbsplugins.de/archive/2019-11-07/Tip_of_the_day_Shell_Execute_a/monkeybreadsoftware_blog_filemaker)
- [Run fmsadmin from script](https://www.mbsplugins.de/archive/2019-05-28/Run_fmsadmin_from_script/monkeybreadsoftware_blog_filemaker)
- [Convert office documents to PDF with LibreOffice](https://www.mbsplugins.de/archive/2018-06-15/Convert_office_documents_to_PD/monkeybreadsoftware_blog_filemaker)
- [Tips for FileMaker Data Migration Tool](https://www.mbsplugins.de/archive/2018-06-09/Tips_for_FileMaker_Data_Migrat/monkeybreadsoftware_blog_filemaker)
- [Execute defaults command with Shell functions](https://www.mbsplugins.de/archive/2017-12-21/Execute_defaults_command_with_/monkeybreadsoftware_blog_filemaker)
- [Convert to MP3 with new Shell commands and ffmpeg](https://www.mbsplugins.de/archive/2017-11-16/Convert_to_MP3_with_new_Shell_/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 11st November 2017 , last changed 27th August 2018

  
[Shell.TerminationReason](ShellTerminationReason.md) - [Shell.WriteInputText](ShellWriteInputText.md)

[HTML Version](ShellWait.shtml)