TrFile_SaveFileDialog |
Presents the user with a dialog, in which the user can specify where to save a file. The function returns with the FilePath of the chosen file. Use this FilePath for other File plug-in functions.
Syntax
TrFile_SaveFileDialog ( switches ; prompt ; { defaultName ;
{ initialFolder } } )
Parameters
switches | not used, reserved for future use. Leave blank or put "-Unused" |
prompt | the prompt that will be displayed to instruct the user |
defaultName | (optional) the default file name of the file to be saved |
initialFolder | (optional) the path to the folder where the dialog initially starts |
Returned Result
Data type returned
Text
Result
FilePath: The function returns a FilePath for the selected file.
Use this FilePath as the basis for other File plug-in functions.
If the user cancels an error code of “$$-1” is returned.
Originated in
Troi File Plug-in 1.0
Compatibility
FileMaker Pro 17 to FileMaker Pro 21 (2024)
Considerations
Filtering now also available on Windows! To change the default filtering see the TrFile_SetDefaultType function, or take a look at “Filtering Files” in the example databases.
Example
Set Field [ myFileName ; TrFile_SaveFileDialog (
"Please choose a file to create" ; "myFile.txt" ; gInititialDir ) ]
If [ Left ( myFileName, 2 ) <> "$$" ]
Set Field [ gErrorCode ; TrFile_CreateFile ( myFileName ) ]
End If
This will ask the user for a file to create, which is then created.
Used in example file
SelectFile.fmp12
Related functions
TrFile_CreateFile |
TrFile_SelectFileDialog |
TrFile_SetDefaultType |
Related script step
Show Save File Dialog |
Related topics
Troi File Plug-in online help (overview)