I’m trying to figure out how to write an Applescript that will Exposé all Finder Windows.
Application Logic
I think the script needs to have this 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
I’m not sure how to get this working though. If there is another utility that does this automatically that’d be great, too.

It’d be less ugly if the part for switching to the previous application was left out: