WIA.SetCurrentDevice
--------------------

Sets the current device.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [WIA](component_WIA.md) | [6.5](newinversion65.md) | ❌ No | ✅ Yes | ❌ No | ❌ No | ❌ No |

MBS( "WIA.SetCurrentDevice"; DeviceID ) 

**MBS**( **"WIA.SetCurrentDevice";** /\* Sets the current device. \*/  
**$DeviceID**) /\* Pass name or unique ID for device.e.g. "Brother DCP-8085DN LAN" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| DeviceID | Pass name or unique ID for device. | "Brother DCP-8085DN LAN" |

### Result

Returns OK or error.

### Description

Sets the current device.  
### Examples

Select a device:

 Set Variable \[$r ; Value:MBS ("WIA.SetCurrentDevice"; WIA Scan::Value )\]  
If \[$r = "OK"\]  
 Show Custom Dialog \["Select Device Dialog Result"; "DeviceID: " &amp; MBS ("[WIA.GetCurrentDevice](WIAGetCurrentDevice.md)") &amp; ¶ &amp; "Name: " &amp; MBS ("[WIA.DevicePropertyValue](WIADevicePropertyValue.md)"; ""; "Nam…\]  
Else  
 Show Custom Dialog \["Select Device Dialog Result"; $r \]  
End If  
### See also

- [WIA.ClearCurrentDevice](WIAClearCurrentDevice.md)
- [WIA.DevicePropertyValue](WIADevicePropertyValue.md)
- [WIA.GetCurrentDevice](WIAGetCurrentDevice.md)

### Example Databases

- [DynaPDF/Scan with WIA to PDF](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Scan%20with%20WIA%20to%20PDF.shtml#5ScriptAnchor_)
- [Win Only/Scanning/WIA Scan](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Win%20Only/Scanning/WIA%20Scan.shtml#5ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Advent calendar - Door 20 - Scan and Recognize](https://www.mbsplugins.de/archive/2024-12-20/MBS_FileMaker_Advent_calendar_/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 6th November 2016 , last changed 6th November 2016

  
[WIA.SelectDeviceDialog](WIASelectDeviceDialog.md) - [WIA.SetDevicePropertyValue](WIASetDevicePropertyValue.md)

[HTML Version](WIASetCurrentDevice.shtml)