2016-05-14 93 views
0

在网站上有关于通过脚本获取文件信息的问题,以及由regulus6633回答良好。提供的解决方案为我在一个文件夹上工作,但我无法让它在应用程序文件上以类似的方式工作。用AppleScript在Finder中打开“获取信息”窗口(再次)

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

的路径是正确的,只要我可以告诉,但它一直返回语法错误:

“搜索得到了一个错误:无法获取应用程序的” Macintosh HD:应用:谷歌浏览器。应用”。

(我是个设计师,而不是一个编码器,所以请原谅,如果答案是显而易见的!)

+0

你可以发布一个链接到已为你工作的问题和答案?你的问题不太清楚... – Adam

回答

0

几乎了它的权利,但‘几乎’能折腾在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 
+0

是的!这工作完美。非常感谢! –