Mobile app version of vmapp.org
Login or Join
Rambettina927

: Export all layers to png in Photoshop including those outside of the canvas area I am using the script inbuilt in photoshop, but if some of my layers work are outside canvas, it trims those

@Rambettina927

Posted in: #AdobePhotoshop #PhotoshopScripting

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

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Rambettina927

1 Comments

Sorted by latest first Latest Oldest Best

 

@Rambettina927

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;
}
}
};

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme