ImageCapture.CloseDevice
------------------------

Requests to close a previously opened session on this device.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [ImageCapture](component_ImageCapture.md) | [6.4](newinversion64.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ❌ No |

MBS( "ImageCapture.CloseDevice" { ; Wait } ) 

**MBS**( **"ImageCapture.CloseDevice";** /\* Requests to close a previously opened session on this device. \*/  
**$Wait**) /\* Optional; Pass 1 to wait till complete.  
Or pass 0 to return immediately.  
Default is 1 to wait.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Wait | Pass 1 to wait till complete.   Or pass 0 to return immediately.   Default is 1 to wait. | 0 | Optional |

### Result

Returns OK or error.

### Description

Requests to close a previously opened session on this device.  
Added 20 seconds timeout for version 8.5.  
### Examples

Closes device:

 Set Variable \[$r ; Value:MBS ("ImageCapture.CloseDevice")\]  
### See also

- [ImageCapture.OpenDevice](ImageCaptureOpenDevice.md)

### Release notes

- **Version 8.4**
    - Changed [ImageCapture.OpenDevice](http://www.mbsplugins.eu/ImageCaptureOpenDevice.shtml) and [ImageCapture.CloseDevice](http://www.mbsplugins.eu/ImageCaptureCloseDevice.shtml) to only request closing of the current session, if there is one open to avoid freeze.
- **Version 8.3**
    - Added wait parameter for [ImageCapture.CloseDevice](http://www.mbsplugins.eu/ImageCaptureCloseDevice.shtml), [ImageCapture.OpenDevice](http://www.mbsplugins.eu/ImageCaptureOpenDevice.shtml), [ImageCapture.RequestDeleteFiles](http://www.mbsplugins.eu/ImageCaptureRequestDeleteFiles.shtml), [ImageCapture.requestOverviewScan](http://www.mbsplugins.eu/ImageCapturerequestOverviewScan.shtml), [ImageCapture.requestScan](http://www.mbsplugins.eu/ImageCapturerequestScan.shtml) and [ImageCapture.requestSelectFunctionalUnit](http://www.mbsplugins.eu/ImageCapturerequestSelectFunctionalUnit.shtml) functions.

### Example Databases

- [Mac only/ImageCapture/ImageCapture](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20only/ImageCapture/ImageCapture.shtml#5ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 8.4pr6](https://www.mbsplugins.de/archive/2018-09-01/MBS_FileMaker_Plugin_version_8/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)

### FileMaker Magazin

- [Ausgabe 6/2022, Seite 12 bis 13](https://filemaker-magazin.de/neuigkeit/4206-Appetithappen-FMM_202206)

This function checks for a license.

Created 11st September 2016 , last changed 14th November 2018

  
[ImageCapture.CameraInfo](ImageCaptureCameraInfo.md) - [ImageCapture.Contents](ImageCaptureContents.md)

[HTML Version](ImageCaptureCloseDevice.shtml)