We are using AppleScript to reveal files from our application in the Finder. If a user has alternatives, e.g., PathFinder, installed as a replacement for Finder, how we can find our what application to tell the AppleScript commands?

link|improve this question

feedback

1 Answer

up vote 1 down vote accepted

You can try using this:

try
    tell application "Path Finder" to reveal "/Users/danielbeck/Downloads"
on error
    tell application "Finder" to reveal folder "Downloads" of home
end try

But this assumes that a user with Path Finder prefers it for the reveal functionality.


Alternatively,

do shell script "open 'file:///Users/danielbeck/Downloads'"

When a user has configured Path Finder to handle file:// URLs, this will open the folder in Path Finder. Only works with folders though.


You can use the following to get a list of processes:

tell application "System Events"
    processes
end tell

Look for a process named Finder. If not found, the user has no running Finder. Or look for one named Path Finder, and if found, use it instead. Etc.

link|improve this answer
Unfortunately, configuring Path Finder to handle Reveal actions from other applications doesn't extend to AppleScript. – Daniel Beck Mar 12 '11 at 8:33
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.