我需要以下方面的帮助。我想创建一个脚本来复制 Windows 的“显示桌面”。但是它不起作用,有人能帮忙吗?
然后我想将其保存在我的 Dock 中,这样我就可以根据需要单击它来显示/隐藏桌面。谢谢。
property windows_hidden: "not set yet"
if windows_hidden is false then
activate application "Finder"
tell application "System Events"
set visible of processes where name is not "Finder" to false
end tell
tell application "Finder" to set collapsed of windows to true
set windows_hidden to true
else
activate application "Finder"
tell application "System Events"
set visible of processes where name is not "Finder" to true
end tell
tell application "Finder" to set collapsed of windows to false
set windows_hidden to false
end if