ImageCapture.Devices
--------------------

Queries list of devices.

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

MBS( "ImageCapture.Devices" { ; Filter } ) 

**MBS**( **"ImageCapture.Devices";** /\* Queries list of devices. \*/  
**$Filter**) /\* Optional; You can filter devices by passing criteria here.  
The filter string can contain camera, scanner, local, remote, bonjour, bluetooth or shared to only show those devices.e.g. "Camera, local" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Filter | You can filter devices by passing criteria here.   The filter string can contain camera, scanner, local, remote, bonjour, bluetooth or shared to only show those devices. | "Camera, local" | Optional      Added in version **8.3**. |

### Result

Returns UUIDs or error.

### Description

Queries list of devices.  
Returns a list of UUIDs for devices.  
Please pass the UUIDs to the [ImageCapture.DeviceInfo](ImageCaptureDeviceInfo.md) function to query details.  
  
Before calling this function, make sure you called [ImageCapture.Initialize](ImageCaptureInitialize.md) once, best in your start script.  
  
Version 10.0 or later filters duplicates away.  
### Examples

List devices:

 Set Variable \[$Devices ; Value:MBS ("ImageCapture.Devices")\]  
\#loop over entries   
Set Variable \[$Count ; Value:ValueCount($Devices )\]  
If \[$Count &gt; 0\]  
 Set Variable \[$Index ; Value:1\]  
 Loop  
 #Check Device  
 Set Variable \[$ID ; Value:GetValue($Devices ; $index )\]  
 New Record/Request  
 Set Field \[Devices::Name ; MBS ("[ImageCapture.DeviceInfo](ImageCaptureDeviceInfo.md)"; $ID ; "name")\]  
 Set Field \[Devices::ID ; $ID \]  
 Set Field \[Devices::Remote ; Let ( \[ r = MBS ("[ImageCapture.DeviceInfo](ImageCaptureDeviceInfo.md)"; $ID ; "remote") \]; If(r = 1; "yes"; "no") )\]  
 Set Field \[Devices::Shared ; Let ( \[ r = MBS ("[ImageCapture.DeviceInfo](ImageCaptureDeviceInfo.md)"; $ID ; "shared") \]; If(r = 1; "yes"; "no") )\]  
 Set Field \[Devices::transportType ; MBS ("[ImageCapture.DeviceInfo](ImageCaptureDeviceInfo.md)"; $ID ; "transportType")\]  
 Set Field \[Devices::serialNumberString ; MBS ("[ImageCapture.DeviceInfo](ImageCaptureDeviceInfo.md)"; $ID ; "serialNumberString")\]  
 Set Field \[Devices::locationDescription ; MBS ("[ImageCapture.DeviceInfo](ImageCaptureDeviceInfo.md)"; $ID ; "locationDescription")\]  
 Set Field \[Devices::persistentIDString ; MBS ("[ImageCapture.DeviceInfo](ImageCaptureDeviceInfo.md)"; $ID ; "persistentIDString")\]  
 Set Field \[Devices::icon ; MBS ("[ImageCapture.DeviceInfo](ImageCaptureDeviceInfo.md)"; $ID ; "icon")\]  
 Set Field \[Devices::capabilities ; MBS ("[ImageCapture.DeviceInfo](ImageCaptureDeviceInfo.md)"; $ID ; "capabilities")\]  
 Commit Records/Requests \[No dialog\]  
 #next  
 Set Variable \[$Index ; Value:$index + 1\]  
 Exit Loop If \[$index &gt; $Count \]  
 End Loop  
End If  
Query devices and names:

 While(   
\[   
 names = "";   
 // query list of devices  
 list = MBS ( "ImageCapture.Devices" );   
 count = ValueCount(list);   
 index = 1  
\] ;   
 index ≤ count ;   
\[   
 id = GetValue(list; index);   
 // query name for each device  
 name = MBS ( "[ImageCapture.DeviceInfo](ImageCaptureDeviceInfo.md)"; id; "name" );   
 names = names &amp; id &amp; " -&gt; " &amp; name &amp; ¶;   
 index = index + 1   
\] ;   
// return all the names  
names )  
<small>  
Example result:   
564E4336-4833-3130-1234-B05CDAC2071A -&gt; Laserdrucker  
CFE92100-67C4-11D4-1234-F8D027D15ACE -&gt; EPSON ET-7700 Series</small>### See also

- [ImageCapture.DeviceInfo](ImageCaptureDeviceInfo.md)
- [ImageCapture.DevicesJSON](ImageCaptureDevicesJSON.md)
- [ImageCapture.Features](ImageCaptureFeatures.md)
- [ImageCapture.Initialize](ImageCaptureInitialize.md)
- [ImageCapture.OpenDevice](ImageCaptureOpenDevice.md)

### Release notes

- **Version 10.0**
    - Changed [ImageCapture.Devices](https://www.mbsplugins.eu/ImageCaptureDevices.shtml) to filter duplicates.
- **Version 8.4**
    - Added alternateNames entry to [ImageCapture.DevicesJSON](http://www.mbsplugins.eu/ImageCaptureDevicesJSON.shtml) to list alternate names we found.
- **Version 8.3**
    - Added [ImageCapture.DevicesJSON](http://www.mbsplugins.eu/ImageCaptureDevicesJSON.shtml) function.

### Example Databases

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

### Blog Entries

- [MBS FileMaker Plugin, version 10.0pr8](https://www.mbsplugins.de/archive/2020-01-11/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

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

This function checks for a license.

Created 11st September 2016 , last changed 14th June 2022

  
[ImageCapture.DeviceInfo](ImageCaptureDeviceInfo.md) - [ImageCapture.DevicesJSON](ImageCaptureDevicesJSON.md)

[HTML Version](ImageCaptureDevices.shtml)