使用 applescript 隐藏所有应用程序
我正在尝试使用 applescript 来隐藏所有打开的应用程序。
tell application "System Events"
set visible of every process whose visible is true and name is not "Finder" to false
end tell
不幸的是它没有按预期工作。
- 我第一次运行它时,它隐藏脚本编辑器,但不隐藏其他应用程序
- 第二次或第三次运行它时,它关闭脚本编辑器和其他应用程序(但不是查找窗口)
我的目标是一旦 applescript 运行,隐藏所有应用程序正在运行的应用程序
I am trying to work on an applescript to hide all apps that are open.
tell application "System Events"
set visible of every process whose visible is true and name is not "Finder" to false
end tell
Unfortunately it is not working as expected.
- The first time when I run it, it hides script editor but not other apps
- The second or third time when I run it, it closes script editor and other apps(but not finder windows)
My goal is as soon as applescript runs, hide all apps that are running
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据 Willeke 的说法,这对我有用:
according to Willeke, this works for me :