@Kukurykus,
Wow, that works! Can't say I understand it fully, but hey, I'm a Fortran programmer, and have only recently (and barely) touched my toes into javascript.
I hope I'm not getting greedy by asking, is there a way to do this as Paste-In-Place rather than just Paste? That is, replace the line
"aD.activeLayer = lrs.pop(), aD.paste(),"
in your script with
"aD.activeLayer = lrs.pop(), aD.pasteInPlace(),"
where pasteInPlace is a function defined somewhere in the script (as it evidently does not exist as a built-in function).
I've made a few attempts to do this, e.g., inserting the following immediately before your script (basically cut & pasted from a search of another forum):
Code: Select all
cTID = function(s) { return app.charIDToTypeID(s); };
sTID = function(s) { return app.stringIDToTypeID(s); };
function pasteInPlace(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
desc1.putBoolean(sTID("InPlace"), true);
desc1.putEnumerated(cTID('AntA'), cTID('Annt'), cTID('Anno'));
executeAction(cTID('paste'), desc1, dialogMode);
};
but this (and other attempts) always produces the error "aD.pasteInPlace() is not a function".
Thanks so much for all your help!