How to Hide All Windows of an App Other Than the Front One

Interestingly, collapsed windows apparently have subrole AXUnknown or AXDialog (for some reason), so this doesn’t work for unminimizing all of an application’s windows. See also Minimize all windows of an application.