Set Finder Comment | 
Sets the Finder comment of a file (macOS only)
Syntax
Set Finder Comment [ Select ; Result (error) ; FilePath ; Comment text ]
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 | 
| FilePath | the path to the file | 
| Comment text | the text of the comment to set | 
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 comment was set. | 
| $$-43 | fnfErr | File not found. | 
| $$-50 | paramErr | There was an error with the parameter. | 
Other errors may be returned.
Originated in
Troi File Plug-in 9.0
Compatibility
FileMaker Pro 18 to FileMaker Pro 22 (2025)
Example
Set Finder Comment [ Select ; gErrorCode ; "Hard Disk:test.doc" ; "Hello Get Info!" ]
This step will set the macOS Finder comment of the file test.doc to “Hello Get Info!”.
You can see the set comment in the Finder, with File -> Get Info.
Related functions
| TrFile_GetFileAttribute | 
| TrFile_SetFinderComment | 
Related topics
Troi File Plug-in online help (overview)