【问题标题】:Open "Get Information" Window in Finder by Applescript (Again)通过 Applescript 在 Finder 中打开“获取信息”窗口(再次)
【发布时间】:2016-05-14 21:14:13
【问题描述】:

网站上有一个关于通过脚本获取文件信息的问题,regulus6633 很好地回答了。提供的解决方案在文件夹上为我工作,但我无法让它在应用程序文件上类似地工作。

set aFile to (POSIX file "/Applications/Google Chrome.app") as text
tell application "Finder" to open information window of application aFile

据我所知,路径是正确的,但它不断返回语法错误:

“Finder 出错:无法获取应用程序“Macintosh HD:Applications:Google Chrome.app”。

(我是设计师,不是程序员,如果答案很明显,请原谅!)

【问题讨论】:

  • 你能发布一个链接到对你有用的问题和答案吗?你的问题不太清楚...

标签: macos applescript finder


【解决方案1】:

几乎是对的,但“几乎”在 AppleScript 中可能会令人沮丧:-)

set aFile to (POSIX file "/Applications/Google Chrome.app") as alias
tell application "Finder" to open information window of aFile

要获取数据,而不是打开窗口查看,使用

set aFile to (POSIX file "/Applications/Google Chrome.app") as alias
info for aFile

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-03-16
    • 1970-01-01
    • 1970-01-01
    • 2019-10-30
    • 2013-11-03
    • 2020-04-28
    • 1970-01-01
    相关资源
    最近更新 更多