Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var orig = app.activeDocument.activeLayer;
- var cnt = 10;
- var increaseOpacity = 10;
- var opacity = 0;
- orig.name = "_a_" + orig.name;
- for (var i = 1; i < cnt; i++) {
- var nlay = orig.duplicate();
- opacity += increaseOpacity;
- nlay.opacity = Math.min(opacity, 100);
- if (nlay.name !== "Black") {
- nlay.name = orig.name + "_" + opacity + "%";
- }
- }
- var background = app.activeDocument.artLayers.add();
- background.name = "Black";
- background.move(orig, ElementPlacement.PLACEBEFORE);
- app.activeDocument.selection.fill(app.foregroundColor);
- background.move(app.activeDocument.layers[10], ElementPlacement.PLACEAFTER);
- var blackCopy = app.activeDocument.artLayers.getByName("Black").duplicate();
- blackCopy.name = "_a_Black Copy";
- blackCopy.move(app.activeDocument.artLayers.getByName("_a_Background_10%"), ElementPlacement.PLACEBEFORE);
- if (orig.name === "_a_Background") {
- orig.name += ",2000"; // Add ",2000" to the end of the layer name
- } else {
- orig.name = layer.name + ",2000"; // Add ",2000" to the end of the layer name
- }
Advertisement
Add Comment
Please, Sign In to add comment