Windows - All documents minimised with Photoshop

Participant ,
Sep 20, 2022 Sep 20, 2022

Copy link to clipboard

Copied

More often than not I will have ALT-TABbed away from Photoshop to the desktop (or maybe the Bahamas), but on my return all previous Photoshop files that I was working on will have been minimised. - This can be quite annoying, especially, if you have several open. 

 

So...I wondered if a script could fix it - just looping over each document and setting it to the active document. And funnily enough, it fixes the problem

 

I'm sharing it here, mainly for future reference for myself... and anyone else who encounters the same thing:

 

// Brings all the minimized documents to the fore
unminimize();

function unminimize()
{
  if (documents.length == 0) return;
  for (var i = 0; i < documents.length; i++)
  {
    app.activeDocument = documents[i];
  }
}

 

 

TOPICS
Actions and scripting , Windows

Views

41

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 20, 2022 Sep 20, 2022

Copy link to clipboard

Copied

Thanks for sharing! Are the windows floating or tabbed?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 21, 2022 Sep 21, 2022

Copy link to clipboard

Copied

Floaty! 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 21, 2022 Sep 21, 2022

Copy link to clipboard

Copied

LATEST

I have only tested on the Mac which works a little different, however, the end result should be the same in Windows:

 

// Maximise all minimised documents
if (app.documents.length) {
    app.runMenuItem(stringIDToTypeID('consolidateAllTabs'));
    app.runMenuItem(stringIDToTypeID('floatAllWindows'));
} else {
    //alert("No docs open!");
}

 

The original SL code that I extracted the menu item command from:

 

if (app.documents.length) {
var idselect = stringIDToTypeID( "select" );
    var desc20 = new ActionDescriptor();
    var idnull = stringIDToTypeID( "null" );
        var ref10 = new ActionReference();
        var idmenuItemClass = stringIDToTypeID( "menuItemClass" );
        var idmenuItemType = stringIDToTypeID( "menuItemType" );
        var idconsolidateAllTabs = stringIDToTypeID( "consolidateAllTabs" );
        ref10.putEnumerated( idmenuItemClass, idmenuItemType, idconsolidateAllTabs );
    desc20.putReference( idnull, ref10 );
executeAction(idselect, desc20, DialogModes.NO);

var idselect = stringIDToTypeID( "select" );
    var desc193 = new ActionDescriptor();
    var idnull = stringIDToTypeID( "null" );
        var ref12 = new ActionReference();
        var idmenuItemClass = stringIDToTypeID( "menuItemClass" );
        var idmenuItemType = stringIDToTypeID( "menuItemType" );
        var idfloatAllWindows = stringIDToTypeID( "floatAllWindows" );
        ref12.putEnumerated( idmenuItemClass, idmenuItemType, idfloatAllWindows );
    desc193.putReference( idnull, ref12 );
executeAction(idselect, desc193, DialogModes.NO);
} else {
    //alert("No docs open!");
}

 

Should be faster as it doesn't have to loop over the files.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

Save time with Adobe Express quick actions