应用程序的路径,而无需打开

问题描述:

我想要去的任何应用程序的路径,这是我做的:应用程序的路径,而无需打开

set i to path to application id "com.adobe.Photoshop" 

这让我的路径,而且也打开Photoshop中。我怎样才能使它不打开Photoshop?

下面是一种方法...使用使用启动服务的lsregister。这给出了所有匹配应用程序的列表。

set lsRegisterPath to "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister" 
set appBundleID to "com.adobe.Photoshop" 

-- get the path to all apps with the bundle id 
set theAppPaths to paragraphs of (do shell script lsRegisterPath & " -dump | grep --before-context=2 \"" & appBundleID & "\" | grep --only-matching \"/.*\\.app\"") 
+0

从http://*.com/questions/3444326/list-all-applications-output-as-text-file复制而来 – sakra 2011-05-02 19:13:21