Shift+Ctrl+Alt+E Stamp Layer script equivalent
A stamp layer is easy via Shift+Ctrl+Alt+E but is pages long in scrptlistener, is there an easy way to scipt this?
A stamp layer is easy via Shift+Ctrl+Alt+E but is pages long in scrptlistener, is there an easy way to scipt this?
Combining the answers and adding a small amount I get this function, it creates the new layer as required, for the stamp layer it does name it as BLUR but for the background only copy it renames the background layer as BLUR and the new layer is Background copy, so I need to get the new layer in focus before the rename action
function stampLayer(){
if (activeDocument.layers.length > 1){
var adStampLayer = new ActionDescriptor();
adStampLayer.putBoolean( charIDToTypeID( "Dplc" ), true );
executeAction( charIDToTypeID( "MrgV" ), adStampLayer, DialogModes.NO ); }
if (!((lrs = (aD = activeDocument).layers).length - 1) && (bG = lrs[0]).isBackgroundLayer) bG.duplicate();
var docRef = activeDocument
docRef.activeLayer.name = "BLUR";
docRef.activeLayer.applyGaussianBlur(20);
};If you want duplication was selected, use this code after bG.duplicate() (before semicolon):
, aD.activeHistoryState = (sH = aD.historyStates)[sH.length - 1]
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.