Stroke Selected layer
Hi
I'm quite new with javascript for Photoshop. I'm writing script that will facilitate my work on files and one of the functions should stroke the active document (2 px stroke)(just like Edit->Stroke function in PS). The script must always stroke the entire open document. Not counting one line with the stroke function itself, everything works fine but does not outline, the script stops working immediately after selection.
Help me please
function ObrysWartswy(){
app.preferences.rulerUnits = Units.PIXELS
app.preferences.typeUnits = TypeUnits.PIXELS
app.displayDialogs = DialogModes.NO
var strokeColor = new SolidColor;
strokeColor.cmyk.Cyan = 0;
strokeColor.cmyk.Magenta = 0;
strokeColor.cmyk.Yellow = 0;
strokeColor.cmyk.Black = 100;
app.activeDocument.selection.selectAll();
app.activeDocument.selection.stroke(strokeColor, 2);
app.activeDocument.selection.deselect();
app.preferences.rulerUnits = Units.CM
app.preferences.typeUnits = TypeUnits.CM
app.displayDialogs = startDisplayDialogs
}
