[英]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.