![]() |
TrFile_Reveal |
Reveals a file (or folder) in the Finder or Explorer.
Syntax
TrFile_Reveal ( switches ; filePath )
Parameters
switches | not used, reserved for future use. Leave blank or put "-Unused" |
filePath | the path to the file to be revealed |
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 | File not found |
$$-50 | paramErr | Parameter error |
Other errors may be returned.
Originated in
Troi File Plug-in 4.5
Compatibility
FileMaker Pro 15 to 19
Considerations
You can reveal files ànd folders!
You can use FileMaker styled paths, like “filewin:/C:/MyFiles/test.txt”.
Example
Set Field [ result ; TrFile_Reveal ( "-Unused" ; "C:\readme.doc" ) ]
This will make the file visible in a Windows Explorer window and select it.
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_Reveal ( "-Unused" ; gFilePath ) ]
This will show the file specified by gFilePath in the Finder or Explorer. It will open the enclosing folder and show the files selected.
Related function
TrFile_Launch |
Related script steps
Reveal File |
Reveal Folder |
Related topics
Troi File Plug-in online help (overview)