English 中文(简体)
• 对所有FinderWindows进行盘点。
原标题:Applescript to Expose all Finder Windows?

I m试图说明如何写出一个将接触所有FinderWindows的果字。

Application Logic

我认为,文字必须具有这一应用逻辑:

  • Check a residual setting and get the name of the last "Frontmost Application" (perhaps use a text file ~/last-application.txt to store this?)
  • Grab the name of the current Frontmost Application
  • If the name of the current of the Frontmost Application is Expose, then activate the previous frontmost application
  • Else, activate finder, and then activate expose for just finder windows

Desired Behavior

  • When the script is activated all the finder windows (and only the finder windows) will be shown in Exposé
  • If the script is then run again (and no finder window was selected) the script will just switch back to the last frontmost application

我不敢肯定如何做到这一点。 如果还有另一个效用,这自然也是巨大的。

“enterography

最佳回答
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}
问题回答

暂无回答




相关问题
2 mysql instances in MAC

i recently switched to mac. first and foremost i installed xampp. then for django-python-mysql connectivity, i "somehow" ended up installing a seperate MySQL. now the seperate mysql installation is ...

Iterating over string/strlen with umlauted characters

This is a follow-up to my previous question . I succeeded in implementing the algorithm for checking umlauted characters. The next problem comes from iterating over all characters in a string. I do ...

Controlling OSX windows

I m trying to control windows of a foreign OSX applications from my application. I d like to 1. move the windows on the screen 2. resize the windows on the screen 3. change the currently active window ...

Switching J2SE versions on Mac OS (SnowLeopard)

My current JDK on Mac OS (10.6) is set to 1.6 and I d like to switch to 1.5. A listing of /System/Library/Frameworks/JavaVM.framework/Versions/ shows: lrwxr-xr-x 1 root wheel 10 Nov 3 18:34 ...

Scrolling inside Vim in Mac s Terminal

I ve been googling around trying to figure out if it s possible to use my mouse wheel to scroll while inside Vim in Mac s Terminal, with no luck. It seems as if only X11 or iTerm support this. Before ...

export to MP3 from quicktime API

A question for Apple,QT programmers. Would like to know if it s possible to export a Movie object to MP3 using the QuickTime API. Preferably the ConvertMovieToFile function. I ve looked at ...

热门标签