Multiple Apps Possible via Launch Services, want to Specify Particular One

Posted by Andrew on Stack Overflow See other posts from Stack Overflow or by Andrew
Published on 2010-04-06T08:13:49Z Indexed on 2010/04/06 8:43 UTC
Read the original article Hit count: 167

Filed under:
|
|
|
|

Here's the issue:

I have a list of App names that I want to launch. They do not include a path (e.g. {"VLC","Microsoft Word"}. I have two different copies of VLC in different directories. I would like Launch Services to ONLY open the one from /Applications/ and not EVER launch from /Applications/AnotherDirectory

I want to get the path of these, and test to see what Launch Services wants to launch (via bash with "open" or applescript via "tell _ to launch" or [NSWorkspace launch...])

The only way that I have come up with to test the path of a file about to be launched by launch services is:

Applescript:

tell application "Finder" to return the (posix path of (path to application "VLC" as alias))

That works fine, but launches the app (which I don't want at all).

Suggestions?

© Stack Overflow or respective owner

Related posts about osx

Related posts about xcode