我正在嘗試使用 applescript 來隱藏所有打開的應用程式。
tell application "System Events"
set visible of every process whose visible is true and name is not "Finder" to false
end tell
不幸的是,它沒有按預期作業。
- 我第一次運行它時,它隱藏了腳本編輯器,但不隱藏其他應用程式
- 第二次或第三次運行它時,它會關閉腳本編輯器和其他應用程式(但不是查找器視窗)
我的目標是一旦 applescript 運行,隱藏所有正在運行的應用程式
uj5u.com熱心網友回復:
根據 Willeke 的說法,這對我有用:
tell application "System Events"
set visibleApps to every process whose visible is true and name is not "Finder"
repeat with theApp in visibleApps
set visible of theApp to false
end repeat
end tell
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/438927.html
上一篇:如何將某些內容附加到串列中?
