MacOS – Restore multiple minimized windows

google-chromemacosminimize

This question particularly deals with the latest version of Google Chrome on Mountain Lion, but the underlying premise applies to other browsers/applications as well.

What I am wondering is: is there a way (via keyboard shortcut, or third party application) to open a series of minimized windows simultaneously?

For example, in Google Chrome, one might have four windows open (each with a set of tabs), that you minimized with ⌘ cmd + M. This leads to a few questions:

  1. Once minimized, is there a keyboard shortcut to bring that window back?

  2. Is there a keyboard shortcut that would bring all minimized windows back?

I would like to restore all minimized windows with a keypress, not just one at a time.

Best Answer

If minimizing windows to the application icon has not been enabled, you can unminimize all windows with a script like this:

try
    tell application "System Events" to tell process "Dock"
        click (UI elements of list 1 where role description is "minimized window dock item")
    end tell
end try

This script would unminimize the last minimized window shown in the Dock:

try
    tell application "System Events" to tell process "Dock"
        click (last UI element of list 1 where role description is "minimized window dock item")
    end tell
end try

This would unminimize all windows in the current application:

tell application (path to frontmost application as text)
    if name is "Finder" then
        set collapsed of windows where collapsed is true to false
    else
        set miniaturized of windows where miniaturized is true to false
    end if
end tell

You can assign shortcuts to scripts by for example using FastScripts or Alfred.