Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

The question is pretty self explanatory: How can one make an Automator script to restore all hidden windows at the same time?

share|improve this question
1  
What do you mean by "hidden windows"? Do you mean hidden applications (which don't appear on the screen at all), minimized windows (which appear as small icons in the right side of the Dock, or both? Or are you refering to windows in a Space other than the active one, which are, technically, hidden from view? –  Daniel Lawson Mar 8 '12 at 2:04
    
Thanks for the request for more detail. I'm a long time windows user so I set stuff to minimize into the application button to feel more at home for now. I guess I meant all of the above, unless it's already open in another space. Is this even possible? –  Julio R. Mar 8 '12 at 3:49
1  
I think so. I'm working on a solution. –  Daniel Lawson Mar 8 '12 at 3:50
add comment

1 Answer 1

up vote 4 down vote accepted

This AppleScript should restore all hidden windows.

The first action unhides any hidden programs. The second action restarts the Dock, which has the effect of un-minimizing any windows minimized to the Dock.

tell application "System Events"
    set the visible of every process to true
    do shell script "killall -HUP Dock"
end tell

If you particularly want an Automator workflow, give it one action: Run AppleScript, and assign this AppleScript.

share|improve this answer
    
Great, though it flashes my screen grey when it runs, but i can live with that. It did miss one application that I keep "minimized" in the menu bar, but with a dock icon hidden by the LSUIElement property in its Info.plist. –  Julio R. Mar 8 '12 at 6:40
    
As far as I can tell, strictly speaking, a window that disappears and can be reopened by clicking a menu bar icon isn't hidden or minimized, it's closed, and clicking the menu bar icon opens it. –  Daniel Lawson Mar 8 '12 at 17:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.