0

I am using the script inbuilt in photoshop, but if some of my layers work are outside canvas, it trims those to the visible area only.

But we need everything in the layer in png, whether is was visible in canvas or it is outside.

Best, Gunjan

  • Hi Gunjan, welcome to GDSE and thanks for your question. If you want to know more about the site, please see the help center or ping one of us in the Graphic Design Chat once your reputation is sufficient (20). Keep contributing and enjoy the site! Did you Google this question, and if so, why weren't the results satisfactory? – PieBie Dec 8 '15 at 7:57
0

I have got the answer from Adobe.

You can append appDocument.revealAll().

Also you can take the snapshot of the same before revealing all and then restore the snapshot. Below is the function you can copy in exporting all layers to file. Then call the takeSnapshot(); first then appDocument.revealAll(); in the start of the main.

and in the end call restoreSnapshot(); to bring it to the same position

function takeSnapshot () { 
   var desc = new ActionDescriptor();
   var sref = new ActionReference();
   sref.putClass(charIDToTypeID("SnpS")); 
   desc.putReference(charIDToTypeID("null"), sref); 
   var fref = new ActionReference(); 
   fref.putProperty(charIDToTypeID("HstS"), charIDToTypeID("CrnH")); 
   desc.putReference(charIDToTypeID("From"), fref ); 
   executeAction(charIDToTypeID("Mk  "), desc, DialogModes.NO ); 
}; 

function restoreSnapshot(){
var doc = app.activeDocument;
var hs = doc.historyStates;
for(var a =hs.length-1;a>=0;--a){
   if(hs[a].snapshot) {
       doc.activeHistoryState = hs[a];
       break;
       }
    }
};

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.