Skip to main content

Open Folder (script step reference)

Troi File Plug-in for FileMaker Pro

Open Folder

Opens a folder in the Finder (on macOS) or in Windows Explorer.

SyntaxScript step badge

Open Folder [ Select ; Result (error) ; folderPath ]

Options

Select entire contents replaces the entire contents of a field with the result. If not checked the result replaces the currently selected portion of the field
Result (error) an error code
FolderPath the path to the folder to be opened

Returned Result

Data type returned

Error code

Result

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 revealed in the Finder or Explorer
$$-35 nsVolErr No such volume (Wrong disk name or not mounted)
$$-43 fnfErr Folder not found
$$-50 paramErr Parameter error

Other errors may be returned.

Originated in

Troi File Plug-in 9.0

Compatibility

FileMaker Pro 16 to FileMaker Pro 2023

Considerations

You can use FileMaker styled paths, like “filewin:/C:/MyFiles/datafolder/”.

Example

Open Folder [ Select ; $ErrorCode ; "C:\MyFiles" ]

This will make the folder visible in a Windows Explorer window.

Example 2

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

  gErrorCode		Global, number
  gFolderPath		Global, text

gFolderPath should contain the path to the folder that you want to open, for example “D:\Data\My Folder” (Windows) or “Mac HD:Data:My Folder” (macOS). In a script add the following script step:

Open Folder [ Select ; $ErrorCode ;  gFolderPath ]

This will show the folder specified by gFolderPath in the Finder or Explorer.

Related script stepsScript step badge

Launch File
Reveal File
Reveal Folder

Related functionsFunction badge

TrFile_Launch
TrFile_Reveal

Related topics

Troi File Plug-in online help (overview)


Online Help Page for Troi File Plug-in for 16 to 2023 –> Open Folder (filep7312) 2023-0601 16:29:56