2016-05-14 92 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

是的!這工作完美。非常感謝! –