TrFile_SaveFileDialog (function reference)

By May 1, 2017May 20th, 2020Online Help, Troi File Plug-in
Troi File Plug-in > Functions reference > TrFile_SaveFileDialog
Troi File Plug-in for FileMaker Pro


Presents the user with a dialog, in which the user can specify where to save a file. The function returns with the FileSpec of the chosen file. Use this FileSpec for other File plug-in functions.

SyntaxFunction badge

TrFile_SaveFileDialog ( switches ; prompt ; { defaultName ;
                        { initialFolder } } )


switchesnot used, reserved for future use. Leave blank or put "-Unused"
promptthe 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



FileSpec: The function returns a FileSpec for the selected file.

Use this FileSpec 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


FileMaker Pro 15 to 19


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.


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.

Related functionsFunction badge


Related script stepScript step badge

Show Save File Dialog

Related topics

Troi File Plug-in online help (overview)

Online Help Page for Troi File Plug-in for 15 to 19 –> TrFile_SaveFileDialog (filep4264) 2020-0520 18:03:35