Needed this for my own uses and didn't turn up any examples from a search so...
Code: Select all// @include "/Applications/Adobe Photoshop CS3/Presets/xtools/xlib/stdlib.js"
var doc = app.activeDocument;
var curveArray = new Array(Array(0,16), Array(16,16), Array(128,128), Array(240,240), Array(255,240));
function curveEm(activeDoc, theLayer) {
if (theLayer.kind == "LayerKind.NORMAL") {
theLayer.adjustCurves(curveArray);
}
}
Stdlib.traverseLayers(doc, curveEm);
adjustCurves
adjustCurves
I think that you will find that you can't apply curves or most filters to a solidfill layer so if (theLayer.kind == ("LayerKind.NORMAL") would have the same effect. The solidfill layers are being trapped by the catch.
Mike
Mike
adjustCurves
This:
Code: Select alltheLayer.kind == "LayerKind.NORMAL"
should really be this:
Code: Select alltheLayer.kind == LayerKind.NORMAL
The first (if it actually does work correctly) does an implicit conversion of theLayer.kind to a String for the comparison, which is not what you typically want.
-X
Code: Select alltheLayer.kind == "LayerKind.NORMAL"
should really be this:
Code: Select alltheLayer.kind == LayerKind.NORMAL
The first (if it actually does work correctly) does an implicit conversion of theLayer.kind to a String for the comparison, which is not what you typically want.
-X