Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

ImageCapture.RequestSelectFunctionalUnit

Requests the scanner device to select a functional unit.

Component Version macOS Windows Linux Server iOS SDK
ImageCapture 6.4 ✅ Yes ❌ No ❌ No ❌ No ❌ No
MBS( "ImageCapture.RequestSelectFunctionalUnit"; Unit { ; Wait } )   More

Parameters

Parameter Description Example Flags
Unit The functional unit to request.
Can be Flatbed, PositiveTransparency, NegativeTransparency or DocumentFeeder.
"Flatbed"
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 the scanner device to select a functional unit.

Examples

Request flatbed unit:

Set Variable [$r; Value:MBS("ImageCapture.requestSelectFunctionalUnit"; "Flatbed")]
If [MBS("isError")]
    Show Custom Dialog ["Failed to get flatbed?"; $r]
    Exit Script []
End If

Request document feeder:

Set Variable [$r; Value:MBS("ImageCapture.requestSelectFunctionalUnit"; "DocumentFeeder")]
If [MBS("isError")]
    Show Custom Dialog ["Failed to get flatbed?"; $r]
    Exit Script []
End If

Open device and request document feeder:

Set Variable [$r ; Value: MBS("ImageCapture.OpenDevice"; Images::Device) ]
If [ MBS("iserror") ]
    Show Custom Dialog [ "Failed to open" ; MBS("Text.RemovePrefix"; $r; "[MBS] ") ]
    Exit Script [ Text Result: ]
End If
Pause/Resume Script [ Duration (seconds): ,1 ]
Set Variable [ $r ; Value: MBS("ImageCapture.GetParameter"; "availableFunctionalUnitTypes") ]
If [ Length ( $r ) > 0 ]
    # if we have more than one, pick one
    Set Variable [ $r ; Value: MBS("ImageCapture.requestSelectFunctionalUnit"; "DocumentFeeder") ]
    If [ MBS("iserror") ]
        Show Custom Dialog [ "Failed to get flatbed?" ; MBS("Text.RemovePrefix"; $r; "[MBS] ") ]
        Exit Script [ Text Result: ]
    End If
End If

See also

Release notes

Blog Entries

Created 11st September 2016, last changed 10th October 2023


ImageCapture.RequestScan - ImageCapture.RequestSyncClock