GetFileName
The GetFileName function opens the Windows Open dialog to browse for a file name string. If the [Open] button is clicked, the selected file name is returned.
|
|
sName, bOK = GetFileName()
If [Open] is clicked, the function returns the file name, sName, and bOK=true.
If the dialog is canceled, "",false is returned.
The bOK return value is optional.
If the user cancels this dialog, this function returns boolean false as the second argument. You do not have to use the second argument in the script, but it can be tested and a decision made before the script proceeds.
The "Flip FITS Images" flag in the dialog options list controls whether FITS images are flipped with row number increasing downward. This global flag is updated after you click [Open]. It can also be configured before this dialog opens by using the CImageView:SetFlipFITS method.
The dialog title can be changed using SetFileOpenDlgTitle.
The window shown above was created using the following code:
The Assert function is used after GetFileName to test how the user closed the dialog. If the dialog was closed by clicking [Open], then bOK=true; otherwise, bOK=false.
Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.