system.vision.openFiles
This function replaces system.file.openFiles. Any scripts containing Vision Client scoped functions that were replaced with system.vision syntax will still work to maintain backwards compatibility. Only the system.vision variations will appear in the Script Editor's autocomplete popup.
This function is used in Python Scripting.
Description​
Shows an Open File dialog box, prompting the user to choose a file or files to open. Returns the paths to the files that the user chooses, or None if the user canceled the dialog box. An extension can optionally be passed in that sets the filetype filter to that extension.
Client Permission Restrictions​
This scripting function has no Client Permission restrictions.
Syntax​
system.vision.openFiles([extension], [defaultLocation])
Parameters​
Type | Parameter | Description |
---|---|---|
String | extension | A file extension, such as "pdf", to try to open. [optional] |
String | defaultLocation | A folder location, such as "C:\MyFiles", to use as the default folder to store in. [optional] |
Returns​
List - The paths to the selected files, or None if canceled.
Scope​
Vision Client
Code Examples​
# This code would prompt the user to open files of type 'gif'.
# If None is returned, it means the user canceled the open dialog box.
paths = system.vision.openFiles('gif')
if paths != None:
# do something with the file
# This code would prompt the user to open files of type 'pdf' from their stored documents folder.
# If None is returned, it means the user canceled the open dialog box.
# Note, the computer running this code needs to have network access to the "fileserver" computer.
path = system.vision.openFiles('pdf', '\\fileserver\PDF_Storage')
if path != None:
# do something with the file
# This code prompts the user to open files of any type and loop through all returned file paths.
paths = system.vision.openFiles()
if len(paths) != 0:
for path in paths:
# Do something with the file.
print path