【发布时间】:2011-08-17 03:50:45
【问题描述】:
我想获得任何应用程序的路径,这就是我所做的:
set i to path to application id "com.adobe.Photoshop"
这为我提供了路径,但也打开了 Photoshop。我怎样才能使它无法打开 Photoshop?
【问题讨论】:
标签: applescript
我想获得任何应用程序的路径,这就是我所做的:
set i to path to application id "com.adobe.Photoshop"
这为我提供了路径,但也打开了 Photoshop。我怎样才能使它无法打开 Photoshop?
【问题讨论】:
标签: applescript
这是一种方法...使用 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\"")