Question
PS scripting problem, script making bleed's
Hello i want to have a script takat creates bleeds,
Usually when im dong this by hand I do this:
1. create naew layer and mae it "bleed", fill it witch bucket tool
2.Expand canvas s
3.Select bleed layer with CMD, clear it, reverse the selection an fill it with color
But i cant figure out how to do step 3. I can ony select the whole layer and not the only filed part
This is my code:
var bleedLayer = app.activeDocument.artLayers.add();
bleedLayer.name = "bleed";
bleedLayer.move(app.activeDocument.artLayers[0], ElementPlacement.PLACEBEFORE);
app.activeDocument.selection.selectAll();
app.activeDocument.selection.fill(app.foregroundColor);
app.activeDocument.selection.deselect();
var doc = app.activeDocument;
var originalWidth = doc.width;
var originalHeight = doc.height;
var newWidth = originalWidth + 10;
var newHeight = originalHeight + 10;
doc.resizeCanvas(newWidth, newHeight, AnchorPosition.MIDDLECENTER);
doc.activeLayer = bleedLayer;
doc.activeLayer = doc.artLayers.getByName("bleed");
doc.selection.load(doc.activeLayer.channels["Transparency"], SelectionType.REPLACE);
doc.selection.clear();
doc.selection.invert();
doc.selection.fill(app.foregroundColor);
doc.selection.deselect();