TrFile_SaveFileDialog (function reference)

By May 1, 2017 May 22nd, 2019 Online Help, Troi File Plug-in
Troi File Plug-in > Functions reference > TrFile_SaveFileDialog
Troi File Plug-in for FileMaker Pro

TrFile_SaveFileDialog

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

Parameters

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

Text

Result

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

Compatibility

FileMaker Pro 14 to 18

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.

Related functionsFunction badge

TrFile_CreateFile
TrFile_SelectFileDialog
TrFile_SetDefaultType

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 14 to 18 –> TrFile_SaveFileDialog (filep4264) 2019-0522 17:10:48