Help modifying values of existing adjustment layer parameters with Javascript
Hi all, I was hoping to get a bit of help setting up some bits of javascript I hoped would be relatively simple.
Essentially I want a script that simply takes the parameter values of a Levels adjustment layer for example, and adds or removes '10' from the Input, Gamma and Output (of RGB composite and/or individual channels).
For example, I got as far as this for changing the opacity of a layer down by 10%:
var opac = Math.round(app.activeDocument.activeLayer.opacity)
app.activeDocument.activeLayer.opacity = opac -10;
The idea is that I could hook this up to panel buttons [-Opacity] and [+Opacity] for example, to quickly drop or increase a layer's opacity by set amounts from a UI button.
I'd like to do this for a Levels adjustment layer too. Buttons/scripts that could be things like '+Red' , '-Red' , '+ RGB Gamma' , '-Blue Gamma' etc.
I tried the script listener approach but I can only figure out how to make explicit values, rather than being able to simply add or remove from the existing values like my opacity snippet above. It's also a shame actions are not able to change values relative to the existing settings, and instead only setting absolute numbers.
Is this possible without a lot of work? I can't imagine why it should be for something so simple in my mind - especially as is the case with the opacity snippet above that can be done in two lines. I'm pretty fresh to scripting in Photoshop, but can hopefully keep up with simple scripts!
P.S. I had a look at this thread but I'm not sure I'm able to put two and two together to do what I'm asking here with that information.
