Jump to content
Server Maintenance This Week. ×

Tell FMP to show a file in the finder


Recommended Posts

  • Newbies

Hello. Sorry – crap at scripting. I have an FMP container field pointing to an mp4 file – well, a stack of them. I have a field that contains the path to each file. I have a button to open the file in its native app quite successfully. I would like a script that instead of opening the file simply reveals it in the finder. I've run the gamut of bad (AppleScript) syntax through damaged libraries and I'm sweating. Any help appreciated. Thanks a lot!

Typical path:

m3 ssd:Users:xxxxxxxx:Movies:music vids:Wild Thing.mp4

Link to comment
Share on other sites

Assuming the path field holds a valid macOS path to the file, try either one of these:

• Calculated AppleScript:

"tell application \"Finder\"¶
activate¶
reveal file \"" & YourTable::Pathfield & "\"¶
end tell"

• Native AppleScript:

set myFile to cell "Pathfield" of current record
tell application "Finder"
activate
reveal file myFile 
end tell 

I believe this variant requires enabling the fmextscriptaccess extended privilege.

 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.