PML File Browser
- Last UpdatedOct 28, 2024
A standard Windows file browser window can be opened by using PML syntax.
Create a File Browser object
import 'PMLFileBrowser'
using namespace 'Aveva.Core.Presentation'
!browser = object PMLFileBrowser('OPEN')
If no argument is given then the object will default to Open, otherwise the user can specify the value Open or Save.
You can query the object and the methods on the PMLFileBrowser instance as follows:
Q Var !browser
Q methods !browser
To show the File Browser dialog use the following syntax:
!browser.show(directory,seed,title,exists,filter,index)
Argument |
Type |
Purpose |
---|---|---|
Directory |
String |
Default directory to display in File Browser. |
Seed |
String |
Default value to be populated in the Name input box of the File Browser. |
Title |
String |
Value to be displayed in the File Browser window title bar. |
Exists |
Boolean |
Check if the input file exists. |
Filter |
String |
The type of files to open. Must be in the format of a description, followed by "|" and then the file types - for example Word Documents|*.DOC or Text files (*.txt)|*.txt|All files (*.*)|*.* |
Index |
Integer |
For multiple strings, the index of the filter currently selected. |
For example the following syntax could be entered at the command line.
!browser.show('C:\','abc.DOC','My Browser',true, 'Word Documents|*.DOC',1)
After entering the command the following window will be displayed.
Note:
The default values have been set as specified:
Use the following syntax to return the name of the file selected in the File Browser window.
q var !browser.file()