: 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
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
More posts by @Rambettina927
1 Comments
Sorted by latest first Latest Oldest Best
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;
}
}
};
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.