1
我想要去的任何應用程序的路徑,這是我做的:應用程序的路徑,而無需打開
set i to path to application id "com.adobe.Photoshop"
這讓我的路徑,而且也打開Photoshop中。我怎樣才能使它不打開Photoshop?
我想要去的任何應用程序的路徑,這是我做的:應用程序的路徑,而無需打開
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\"")
從http://stackoverflow.com/questions/3444326/list-all-applications-output-as-text-file複製而來 – sakra 2011-05-02 19:13:21