Skip to main content

TrFile_SaveFileDialog (function reference)

By June 1, 2024June 4th, 2024Online 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 FilePath of the chosen file. Use this FilePath for other File plug-in functions.

SyntaxFunction badge

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 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 17 to 2024 –> TrFile_SaveFileDialog (filep4264) 2024-0604 19:29:48