Skip to main content

TrFile_SaveFileDialog (function reference)

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 } } )


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



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 16 to FileMaker Pro 2023


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.

Used in example file


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 16 to 2023 –> TrFile_SaveFileDialog (filep4264) 2023-0601 15:56:30