WIA.ImageCount
--------------

Queries number of scanned images.

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

MBS( "WIA.ImageCount" ) ### Parameters

none

### Result

Returns number or error.

### Description

Queries number of scanned images.  
### Examples

Import Images Script:

 Set Variable \[ $count ; Value:MBS ( "WIA.ImageCount") \]  
If \[ $count &gt; 0 \]  
 Set Variable \[ $i ; Value:0 \]  
 Go to Layout \[ “Images” (Images) \]  
 Loop  
 Set Variable \[ $ImagePath ; Value:MBS ( "[WIA.Image](WIAImage.md)"; $i ) \]  
 If \[ MBS ( "[Files.FileExists](FilesFileExists.md)"; $ImagePath ) \]  
 Set Variable \[ $image ; Value:MBS ( "[Container.ReadFile](ContainerReadFile.md)"; $ImagePath ) \]  
 New Record/Request  
 Set Field \[ Images::Name ; MBS ( "[Path.LastPathComponent](PathLastPathComponent.md)"; $ImagePath ) \]  
 Set Field \[ Images::Image ; $image \]  
 Commit Records/Requests \[ No dialog \]  
 End If  
 #Next  
 Set Variable \[ $i ; Value:$i + 1 \]  
 Exit Loop If \[ $i &gt;= $count \]  
 End Loop  
End If  
### See also

- [Container.ReadFile](ContainerReadFile.md)
- [Files.FileExists](FilesFileExists.md)
- [Path.LastPathComponent](PathLastPathComponent.md)
- [WIA.Image](WIAImage.md)
- [WIA.ImageDialog](WIAImageDialog.md)

### Example Databases

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

This function is free to use.

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

  
[WIA.Image](WIAImage.md) - [WIA.ImageDialog](WIAImageDialog.md)

[HTML Version](WIAImageCount.shtml)