2

I installed Afloat for Mac OS X and I really like that it has a shortcut to "Reveal Current File in Finder". This works for basically all applications written in Cocoa.

Can I use something like that, possibly applescript and the scripts menu, to get the path of the current open file, possibly in any application? I'd love to be able to set that to a shortcut key (I can manage that part).

Thanks!

1 Answer 1

4
tell application (path to frontmost application as text)
    set p to path of document 1
end tell

tell application "Finder"
    reopen
    activate
    set selection to {}
    set target of window 1 to POSIX file p
end tell
1
  • I used a similar script and it did work but since all of a sudden I'm always getting missing value – any idea? Jan 20, 2015 at 17:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .