Skip to main content

TrFile_Launch (function reference)

Troi File Plug-in for FileMaker Pro


Opens a file with the application that has registered it. This is the same application that would open it if you would manually double-click it.

SyntaxFunction badge

TrFile_Launch ( switches ; filePath ; { params } )


switches not used, reserved for future use. Leave blank or put "-Unused"
filePath the path to the file to be launched
params (optional) extra parameters to be sent to the launching application (Windows only)

Returned Result

Data type returned

Error code


The returned result is an error code. An error always starts with 2 dollars, followed by the error code. You should always check for errors. Returned error codes can be:

0 no error The file was opened with its application
$$-35 nsVolErr No such volume (Wrong disk name or not mounted)
$$-43 fnfErr File not found
$$-50 paramErr Parameter error
$$-1 genericErr The file could not be opened

Other errors may be returned.

Originated in

Troi File Plug-in 1.2


FileMaker Pro 16 to FileMaker Pro 2023


On the Mac the program that opens the file is determined by the FileType of the file.
On Windows this is determined by the 3 letter extension of the file.
So a text file “ReadMe.txt” will usually be opened by SimpleText (Mac) or WordPad (Windows).

On Windows you can add extra parameters to the launch command, which are then sent to the launching application.


Set Field [ result ; TrFile_Launch ( "-Unused" ;  "C:\readme.doc" ) ]

This will open the file in the application Microsoft Word.

Example 2

We assume that in your FileMaker file the following fields are defined:

  gErrorCode		Global, number
  gFilePath		Global, text

gFilePath should contain the path to the file, for example “D:\Logs\L01.TXT” (Windows) or “Mac HD:Logs:Log 1” (Mac). In a script add the following script step:

Set Field [ gErrorCode ; TrFile_Launch ( "-Unused" ;  gFilePath ) ]

This will launch the file specified by gFilePath with its application.

Used in example file


Related functionsFunction badge


Related script stepsScript step badge

Launch Application
Launch File

Related topics

Troi File Plug-in online help (overview)

Online Help Page for Troi File Plug-in for 16 to 2023 –> TrFile_Launch (filep4252) 2023-0601 15:44:49