我正在试图弄清楚如何编写一个可以Exposé所有Finder Windows的Applescript。
我认为脚本需要具有此应用程序逻辑:
我不知道如何让这个工作。如果有另一个实用程序自动执行此操作,那也很棒。
答案 0 :(得分:1)
set f to "/s/x/finderexpose"
set prev to do shell script "touch " & f & "; cat " & f
if prev is not "" then
delay 0.5 -- time to release modifier keys used in a shortcut
tell application "System Events" to key code 53 -- esc, if Exposé is open
delay 0.3 -- for the Exposé animation?
activate application prev
do shell script "echo '' > " & f
else
do shell script "echo " & quoted form of (path to frontmost application as text) & " > " & f
activate application "Finder"
delay 0.05
tell application "System Events" to key code 125 using {control down} -- ⌃↓
end if
如果切换到之前的应用程序的部分被遗漏了,那就不那么难看了:
activate application "Finder"
delay 0.05
tell application "System Events" to key code 125 using {control down}