FileNameParams Table
The FileNameParams table contains properties used by the GetFileOpen and GetFileSave functions. The table values are used by these dialogs. You can override the properties of these two dialogs by creating a table and setting the value names and values.
These properties are used to soverride the default properties of the GetFileOpen and GetFileSave dialogs. The dialogs also return a new FileNameParams table containing updated property values.
Table Property |
Default Value |
Description |
bOpenFile |
false |
Set true to get an Open dialog. |
sOpenTitle |
"Open" |
Sets the title used for the Open dialog. The default title is "Open". |
bSaveFile |
false |
Set true to get a Save As dialog. |
sSaveTitle |
"Save As" |
The title used for the Save As dialog. The default title is "Save As". |
These parameters are used to override the default properties of the GetFileOpen and GetFileSave dialogs. The dialogs also return a new FileNameParams table containing updated property values.
|
|
|
Table Property |
Default Value |
Description |
bUseImageSet |
false |
Sets theUse Image Set flag on the file dialog. |
bFlipFitsFiles |
false |
Sets theFlip Fits Images flag on the file dialog. |
nMaxFiles |
100 |
Sets the maximum number of files that can be selected. |
nFilterIndex |
1 |
Sets the index of the default file extension (filter) when the sFilterList property contains more than one extension. This is an advanced property. |
sFilterList |
"" |
Specifies the optional file extension filter list. This is an advanced property. |
sStartDir |
"" |
Specifies the starting directory. |
sFileName |
"" |
Specifies the default file name. |
sFileExt |
"" |
Specifies the default file extension. |
In Windows, the GetFileOpen and GetFileSave dialogs use a list of file type filters that follows a very specific format. The filter list is a single character string broken into parts by | characters, with two parts making a single file filter. Thus, if there were 3 filters specified in the string, there would be 6 parts. For each filter, the first part gives a filter description and the second part specifies the file filter that appears in theFile Name: box of the dialog. For example, Text files (*.txt) would be a description for text files and *.txt would be the actual file filter used to select files in the GetFileOpen and GetFileSave dialogs.
This example sets up the GetFileOpen dialog to select a text file with more than one filter.
|
-- enable using a custom list of file types |
|
|
-- the custom list of file types |
|
|
-- notice using the concatenation operator |
|
|
-- enable choosing the filter index |
|
|
-- index 2 chooses text files (*.txt) |
|
|
-- open the Open dialog with a title |
|
The following scripts show several ways to override the default properties of the GetFileOpen function using a FileNameParams table :
|
-- setup a FileNameParams table |
|
-- (use a comma after each value) |
|
-- the new title for the Open dialog |
|
|
|
-- set the new properties |
|
|
|
-- setup a FileNameParams table |
|
-- (use a comma after each value) |
|
-- the new title for the Open dialog |
|
|
|
-- Return the file name and changed params |
|
-- list the new file extension |
|
|
|
-- setup a FileNameParams table |
|
-- (use a comma after each value) |
|
-- the new title for the Open dialog |
|
|
|
-- Return the file name and changed params |
|
|
Mira Pro x64 Script User's Guide, v.8.77 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.