繁体   English   中英

在Applescript的Finder中打开“获取信息”窗口(再次)

[英]Open “Get Information” Window in Finder by Applescript (Again)

网站上存在一个有关通过脚本获取文件信息的问题,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”。

(我是设计师,而不是编码员,所以如果答案很明显,请原谅!)

几乎是正确的,但是“几乎”可能会在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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM