Skip to end of metadata
Go to start of metadata


This feature is new in Ignition version 7.9.5
Click here to check out the other new features
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.file.openFile([extension], [defaultLocation])

  • Parameters

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

String defaultLocation - A folder location, like "C:\MyFiles", to use as the starting location for the file chooser. [optional]

  • Returns

List of Strings The paths to the selected files, or None if canceled.

  • Scope

Client

Code Examples
Code Snippet
# 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.file.openFiles('gif')
if paths != None:
   # do something with the file
Code Snippet
# 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.file.openFiles('pdf', '\\fileserver\PDF_Storage')
if path != None:
   # do something with the file
  • No labels