Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: edits/style
Scripting_function


Panel
titleDescription

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 permissions restrictions


Panel
titleSyntax

system.file.openFiles([extension], [defaultLocation])

  • Parameters

String extension - A file extension, like such as "pdf", to try to open. [optional]

String defaultLocation - A folder location, like such as "C:\MyFiles", to use as the default folder to store in. [optional]

  • Returns

List of Strings List The a list of strings representing the paths to the selected files, or None if canceled.

  • Scope

Vision Client

Panel
titleCode Examples
Code Block
languagepy
titleCode Snippet
# This code prompts the user to open files of type 'gif'. If None is returned, it means the user canceled the open dialog box.
 
paths = system.file.openFiles('gif')
if paths != None:
   # Do something with the file.
Code Block
languagepy
titleCode Snippet
# This code prompts 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.file.openFiles('pdf', '\\fileserver\PDF_Storage')
if path != None:
   # Do something with the file.
Code Block
languagepy
titleCode Snippet
# This code prompts the user to open files of any type and loop through all returned file paths.
 
paths = system.file.openFiles()
if len(paths) != 0:
	for path in paths:
		# Do something with the file.
		print path
Panel
titleKeywords

system file openFiles, file.openFiles