IOSFiles
Defines the public contract for the OSFiles class, exposing cross-platform file and folder selection dialogs (Windows FileDialog and macOS AppleScript), iteration over multi-selections, and validation helpers.
Elements
File #
Current loaded file path
Signature:
Public Property Get File() As String: End Property
File and folder path accessors.
Returns: String. The first selected file path.
Files #
All loaded file paths from a multi-selection
Signature:
Public Property Get Files() As Variant: End Property
Returns: Variant. Zero-based string array of file paths.
Folder #
Current loaded folder path
Signature:
Public Property Get Folder() As String: End Property
Returns: String. The first selected folder path.
Folders #
All loaded folder paths from a multi-selection
Signature:
Public Property Get Folders() As Variant: End Property
Returns: Variant. Zero-based string array of folder paths.
Selecting
LoadFile #
Show a single-file picker dialog
Signature:
Public Sub LoadFile(ByVal filters As String, _
Optional ByVal customMacFilter As String = vbNullString)
File and folder picker operations.
Parameters:
filters: String. File type filters (e.g. ".xlsx", ".xlsb, *.xlsx").customMacFilter: String. Optional UTI override for macOS. Defaults to vbNullString.
LoadFiles #
Show a multi-file picker dialog
Signature:
Public Sub LoadFiles(ByVal filters As String, _
Optional ByVal customMacFilter As String = vbNullString)
Parameters:
filters: String. File type filters.customMacFilter: String. Optional UTI override for macOS. Defaults to vbNullString.
LoadFolder #
Show a single-folder picker dialog
Signature:
Public Sub LoadFolder(): End Sub
LoadFolders #
Show a multi-folder picker dialog
Signature:
Public Sub LoadFolders(): End Sub
ResetFilesIterator #
Reset the iteration cursor over selected files
Signature:
Public Sub ResetFilesIterator(): End Sub
HasNextFile #
Check if another file is available in the iterator
Signature:
Public Function HasNextFile() As Boolean: End Function
Returns: Boolean. True when the cursor has not reached the end.
NextFile #
Retrieve the next file path and advance the cursor
Signature:
Public Function NextFile() As String: End Function
Returns: String. The next file path.
ResetFoldersIterator #
Reset the iteration cursor over selected folders
Signature:
Public Sub ResetFoldersIterator(): End Sub
HasNextFolder #
Check if another folder is available in the iterator
Signature:
Public Function HasNextFolder() As Boolean: End Function
Returns: Boolean. True when the cursor has not reached the end.
NextFolder #
Retrieve the next folder path and advance the cursor
Signature:
Public Function NextFolder() As String: End Function
Returns: String. The next folder path.
Validation
HasValidFile #
Whether the loaded file path is valid
Signature:
Public Function HasValidFile() As Boolean: End Function
Selection validity checks.
Returns: Boolean. True when a non-empty file path exists.
HasValidFiles #
Whether the loaded files array contains entries
Signature:
Public Function HasValidFiles() As Boolean: End Function
Returns: Boolean. True when at least one file was selected.
HasValidFolder #
Whether the loaded folder path is valid
Signature:
Public Function HasValidFolder() As Boolean: End Function
Returns: Boolean. True when a non-empty folder path exists.
HasValidFolders #
Whether the loaded folders array contains entries
Signature:
Public Function HasValidFolders() As Boolean: End Function
Returns: Boolean. True when at least one folder was selected.