Photoshop scipt

I use some photoshop scripts for my work, and all the time try to found a way to repeat previous curves adjusting, since many times it is necessary to repeat a similar (but not the same, so that I can slightly correct it) correction for the same type of images.

I have no problem with opening any curves preset with sripting... however, using the presets is too limited, because picking them up takes longer than changing the settings myself. I need a script where the curves would open with the previous values ​​just like it is done in photoshop with ALT+CTRL+M.

If record action (with pressing ALT + CTRL + M), the current value of the curves is simply recorded and not a repetition of the previous one.

So it possible to do this with jsx?

Many thanks!

While curves dialog create in script, this piece of code appears:

    var idpresetKind = stringIDToTypeID( "presetKind" );
    var idpresetKindType = stringIDToTypeID( "presetKindType" );
    var idpresetKindCustom = stringIDToTypeID( "presetKindUserDefined" );

Perhaps somewhere in the bowels of the Photoshop libraries there is a "preset" that repeats the previous value?

1 answer

  • answered 2022-05-03 07:47 Ghoul Fool

    If I understand you correctly, you can load an existing .acv file and then aplly the curves to it.

    var myCurves = "D:\\temp\\myCurvesFile.acv"; // change to your file
    
    curves(myCurves); // ivoke function
    
    
    function curves(afile)
    {
        // =======================================================
        var idCrvs = charIDToTypeID( "Crvs" );
        var desc14 = new ActionDescriptor();
        var idpresetKind = stringIDToTypeID( "presetKind" );
        var idpresetKindType = stringIDToTypeID( "presetKindType" );
        var idpresetKindUserDefined = stringIDToTypeID( "presetKindUserDefined" );
        desc14.putEnumerated( idpresetKind, idpresetKindType, idpresetKindUserDefined );
        var idUsng = charIDToTypeID( "Usng" );
        desc14.putPath( idUsng, new File( afile ) );
        executeAction( idCrvs, desc14, DialogModes.NO );
    }
    

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum