Search

User Manual

GETTING STARTED


MODULES AND PLATFORM


APPENDIX


TUTORIALS & HELPFUL TRICKS


STRATEGIC PARTNER LINKS

Sepasoft - MES Modules
Cirrus Link - MQTT Modules

RESOURCES

Inductive University
Ignition Demo Project
Knowledge Base Articles
Forum
IA Support
SDK Documentation
SDK Examples

ALL USER MANUAL VERSIONS

Ignition 8.1
Ignition 7.9
Ignition 7.8

Deprecated Pages

Employees

Sign In

Skip to end of metadata
Go to start of metadata

This function is used in Python Scripting.

Description

Shows an "Open File" dialog box, prompting the user to choose a file to open. Returns the path to the file that the user chose, 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 default folder to store in. [optional]

  • Returns

String - The path to the selected file, or None if canceled.

  • Scope

Vision Client

Code Examples
Code Snippet - Opening a File
# This code would prompt the user to open a file of type 'gif'. If None is returned, it means the user canceled the open dialog box.
 
path = system.file.openFile('gif')
if path != None:
   # do something with the file
Code Snippet - Opening a File and Specifying a Default Location
# This code would prompt the user to open a file 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.openFile('pdf', '\\fileserver\PDF_Storage')
if path != None:
   # do something with the file
Keywords

system file openFile, file.openFile 

  • No labels