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];
}
}
Copy link to clipboard
Copied
Thanks for sharing! Are the windows floating or tabbed?
Copy link to clipboard
Copied
Floaty!
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Remind me to look into windows that are duplicated. - ie New window for (Window > Arrange > new window for doc XYZ) As those aren't covered int he same way.