Minimize all windows of an application?

There is a nice discussion about closing all the windows of an application. Are there simple ways (AppleScript would be fine) to minimize all windows of an application? I know I can option-click the minimize circle at the upper left of one of the application’s windows.

More difficult would be one to unminimize all windows of an application. This would be particularly useful because there is no natural OS-X interface (that I know of) for this.

See:

I was poking around in my plugins folder and found a couple of things from 2013. One was Unminimize All Windows (of front application). It appears that I got it from Peter. Here’s the AppleScript text. Guess changing false to true would give me a script to minimize all windows of the front application.


    tell application (path to frontmost application as text)
    try
        using terms from application "Mail"
            set miniaturized of windows to false -- most apps
        end using terms from
    end try
    try
        using terms from application "Finder"
            set collapsed of windows to false -- Finder
        end using terms from
    end try
end tell

If you want to leave the frontmost window unminiimized, just use rest of windows

See also How to hide all windows of an application.