Is there any jsx to execute the auto tone of camera raw ?

Explorer ,
Nov 06, 2018 Nov 06, 2018

Copy link to clipboard

Copied

I write some code to execute the auto tone of camera raw , but the image has no effects. I konw the Action Manager can't record the auto tone of camera raw,so i add the follow code :

desc1.putBoolean(charIDToTypeID('Auto'), true);

and  the auto function is still not work.Any help will be appreciated!

All code is as follows:

(function () {

  // Camera Raw Filter

    var desc1 = new ActionDescriptor();

    desc1.putString(charIDToTypeID('CMod'), "Filter");

    desc1.putEnumerated(charIDToTypeID('Sett'), charIDToTypeID('Sett'), charIDToTypeID('Cst '));

    desc1.putEnumerated(charIDToTypeID('WBal'), charIDToTypeID('WBal'), charIDToTypeID('AsSh'));

    desc1.putBoolean(charIDToTypeID('Auto'), true);

    desc1.putInteger(charIDToTypeID('Temp'), 0);

    desc1.putInteger(charIDToTypeID('Tint'), 0);

    desc1.putBoolean(charIDToTypeID('CtoG'), false);

    desc1.putInteger(charIDToTypeID('Strt'), 0);

    desc1.putInteger(charIDToTypeID('Shrp'), 0);

    desc1.putInteger(charIDToTypeID('LNR '), 0);

    desc1.putInteger(charIDToTypeID('CNR '), 0);

    desc1.putInteger(charIDToTypeID('VigA'), 0);

    desc1.putInteger(charIDToTypeID('BlkB'), 0);

    desc1.putInteger(charIDToTypeID('RHue'), 0);

    desc1.putInteger(charIDToTypeID('RSat'), 0);

    desc1.putInteger(charIDToTypeID('GHue'), 0);

    desc1.putInteger(charIDToTypeID('GSat'), 0);

    desc1.putInteger(charIDToTypeID('BHue'), 0);

    desc1.putInteger(charIDToTypeID('BSat'), 0);

    desc1.putInteger(charIDToTypeID('Vibr'), 0);

    desc1.putInteger(charIDToTypeID('HA_R'), 0);

    desc1.putInteger(charIDToTypeID('HA_O'), 0);

    desc1.putInteger(charIDToTypeID('HA_Y'), 0);

    desc1.putInteger(charIDToTypeID('HA_G'), 0);

    desc1.putInteger(charIDToTypeID('HA_A'), 0);

    desc1.putInteger(charIDToTypeID('HA_B'), 0);

    desc1.putInteger(charIDToTypeID('HA_P'), 0);

    desc1.putInteger(charIDToTypeID('HA_M'), 0);

    desc1.putInteger(charIDToTypeID('SA_R'), 0);

    desc1.putInteger(charIDToTypeID('SA_O'), 0);

    desc1.putInteger(charIDToTypeID('SA_Y'), 0);

    desc1.putInteger(charIDToTypeID('SA_G'), 0);

    desc1.putInteger(charIDToTypeID('SA_A'), 0);

    desc1.putInteger(charIDToTypeID('SA_B'), 0);

    desc1.putInteger(charIDToTypeID('SA_P'), 0);

    desc1.putInteger(charIDToTypeID('SA_M'), 0);

    desc1.putInteger(charIDToTypeID('LA_R'), 0);

    desc1.putInteger(charIDToTypeID('LA_O'), 0);

    desc1.putInteger(charIDToTypeID('LA_Y'), 0);

    desc1.putInteger(charIDToTypeID('LA_G'), 0);

    desc1.putInteger(charIDToTypeID('LA_A'), 0);

    desc1.putInteger(charIDToTypeID('LA_B'), 0);

    desc1.putInteger(charIDToTypeID('LA_P'), 0);

    desc1.putInteger(charIDToTypeID('LA_M'), 0);

    desc1.putInteger(charIDToTypeID('STSH'), 0);

    desc1.putInteger(charIDToTypeID('STSS'), 0);

    desc1.putInteger(charIDToTypeID('STHH'), 0);

    desc1.putInteger(charIDToTypeID('STHS'), 0);

    desc1.putInteger(charIDToTypeID('STB '), 0);

    desc1.putInteger(charIDToTypeID('PC_S'), 0);

    desc1.putInteger(charIDToTypeID('PC_D'), 0);

    desc1.putInteger(charIDToTypeID('PC_L'), 0);

    desc1.putInteger(charIDToTypeID('PC_H'), 0);

    desc1.putInteger(charIDToTypeID('PC_1'), 25);

    desc1.putInteger(charIDToTypeID('PC_2'), 50);

    desc1.putInteger(charIDToTypeID('PC_3'), 75);

    desc1.putDouble(charIDToTypeID('ShpR'), 1);

    desc1.putInteger(charIDToTypeID('ShpD'), 25);

    desc1.putInteger(charIDToTypeID('ShpM'), 0);

    desc1.putInteger(charIDToTypeID('PCVA'), 0);

    desc1.putInteger(charIDToTypeID('GRNA'), 0);

    desc1.putInteger(charIDToTypeID('LPEn'), 0);

    desc1.putInteger(charIDToTypeID('MDis'), 0);

    desc1.putInteger(charIDToTypeID('PerV'), 0);

    desc1.putInteger(charIDToTypeID('PerH'), 0);

    desc1.putDouble(charIDToTypeID('PerR'), 0);

    desc1.putInteger(charIDToTypeID('PerS'), 100);

    desc1.putInteger(charIDToTypeID('PerA'), 0);

    desc1.putInteger(charIDToTypeID('PerU'), 0);

    desc1.putDouble(charIDToTypeID('PerX'), 0);

    desc1.putDouble(charIDToTypeID('PerY'), 0);

    desc1.putInteger(charIDToTypeID('AuCA'), 0);

    desc1.putDouble(charIDToTypeID('Ex12'), 0);

    desc1.putInteger(charIDToTypeID('Cr12'), 0);

    desc1.putInteger(charIDToTypeID('Hi12'), 0);

    desc1.putInteger(charIDToTypeID('Sh12'), 0);

    desc1.putInteger(charIDToTypeID('Wh12'), 0);

    desc1.putInteger(charIDToTypeID('Bk12'), 0);

    desc1.putInteger(charIDToTypeID('Cl12'), 0);

    desc1.putInteger(charIDToTypeID('DfPA'), 0);

    desc1.putInteger(charIDToTypeID('DPHL'), 30);

    desc1.putInteger(charIDToTypeID('DPHH'), 70);

    desc1.putInteger(charIDToTypeID('DfGA'), 0);

    desc1.putInteger(charIDToTypeID('DPGL'), 40);

    desc1.putInteger(charIDToTypeID('DPGH'), 60);

    desc1.putInteger(charIDToTypeID('Dhze'), 0);

    desc1.putInteger(charIDToTypeID('TMMs'), 0);

    var list1 = new ActionList();

    list1.putInteger(0);

    list1.putInteger(0);

    list1.putInteger(255);

    list1.putInteger(255);

    desc1.putList(charIDToTypeID('Crv '), list1);

    var list2 = new ActionList();

    list2.putInteger(0);

    list2.putInteger(0);

    list2.putInteger(255);

    list2.putInteger(255);

    desc1.putList(charIDToTypeID('CrvR'), list2);

    var list3 = new ActionList();

    list3.putInteger(0);

    list3.putInteger(0);

    list3.putInteger(255);

    list3.putInteger(255);

    desc1.putList(charIDToTypeID('CrvG'), list3);

    var list4 = new ActionList();

    list4.putInteger(0);

    list4.putInteger(0);

    list4.putInteger(255);

    list4.putInteger(255);

    desc1.putList(charIDToTypeID('CrvB'), list4);

    desc1.putString(charIDToTypeID('CamP'), "Embedded");

    desc1.putString(charIDToTypeID('CP_D'), "54650A341B5B5CCAE8442D0B43A92BCE");

    desc1.putInteger(charIDToTypeID('PrVe'), 167772160);

    desc1.putString(charIDToTypeID('Rtch'), "");

    desc1.putString(charIDToTypeID('REye'), "");

    desc1.putString(charIDToTypeID('LCs '), "");

    desc1.putString(charIDToTypeID('Upri'), "<x:xmpmeta xmlns:x=\"adobe:ns:meta/\" x:xmptk=\"Adobe XMP Core 5.6-c140 79.160451, 2017/05/06-01:08:21        \">\n <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n  <rdf:Description rdf:about=\"\"\n    xmlns:crs=\"http://ns.adobe.com/camera-raw-settings/1.0/\"\n   crs:UprightVersion=\"151388160\"\n   crs:UprightCenterMode=\"0\"\n   crs:UprightCenterNormX=\"0.5\"\n   crs:UprightCenterNormY=\"0.5\"\n   crs:UprightFocalMode=\"0\"\n   crs:UprightFocalLength35mm=\"35\"\n   crs:UprightPreview=\"False\"\n   crs:UprightTransformCount=\"6\"/>\n </rdf:RDF>\n</x:xmpmeta>\n");

    desc1.putString(charIDToTypeID('GuUr'), "<x:xmpmeta xmlns:x=\"adobe:ns:meta/\" x:xmptk=\"Adobe XMP Core 5.6-c140 79.160451, 2017/05/06-01:08:21        \">\n <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n  <rdf:Description rdf:about=\"\"\n    xmlns:crs=\"http://ns.adobe.com/camera-raw-settings/1.0/\"\n   crs:UprightFourSegmentsCount=\"0\"/>\n </rdf:RDF>\n</x:xmpmeta>\n");

    desc1.putString(charIDToTypeID('Look'), "");

    desc1.putString(charIDToTypeID('Pset'), "");

    executeAction(stringIDToTypeID('Adobe Camera Raw Filter'), desc1, DialogModes.NO);

})();

TOPICS
Actions and scripting

Views

4.8K

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Adobe Community Professional , Nov 06, 2018 Nov 06, 2018
Trydesc1.putBoolean(charIDToTypeID("AuTn"), true);

Likes

Translate

Translate
Adobe Community Professional , Oct 31, 2019 Oct 31, 2019

Likes

Translate

Translate
Adobe Community Professional ,
Nov 06, 2018 Nov 06, 2018

Copy link to clipboard

Copied

Try

desc1.putBoolean(charIDToTypeID("AuTn"), true);

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 06, 2018 Nov 06, 2018

Copy link to clipboard

Copied

Thank you very much. You are right.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 10, 2020 May 10, 2020

Copy link to clipboard

Copied

Hi zero3s,

 

Could you share the JSX for me?

When I copy your script and use it with Photoshop 2020/ACR 12.2 it does nothing? It runs the script, but there are no changes.

 

I did try to add and replace: desc1.putBoolean(charIDToTypeID('Auto'), true); with desc1.putBoolean(charIDToTypeID("AuTn"), true); in your script. But it didn't solve it.

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
May 10, 2020 May 10, 2020

Copy link to clipboard

Copied

Try this for a more concise block of code that only does one thing in the Camera Raw Filter (not to be confused with ACR, Adobe Camera Raw):

 

 

 

 

(function () {
  // Camera Raw Filter - Auto
    var desc1 = new ActionDescriptor();
    desc1.putBoolean(charIDToTypeID("AuTn"), true); // AuTn = Auto
    executeAction(stringIDToTypeID('Adobe Camera Raw Filter'), desc1, DialogModes.NO);
})();

 

 

 

or:

 

 

autoCRF();

function autoCRF() {
  // Camera Raw Filter - Auto
    var desc1 = new ActionDescriptor();
    desc1.putBoolean(charIDToTypeID("AuTn"), true); // AuTn = Auto
    executeAction(stringIDToTypeID('Adobe Camera Raw Filter'), desc1, DialogModes.NO);
}

 

 

P.S. ACR and raw files would be covered by this topic post:

 

How to record button click on action?

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
May 10, 2020 May 10, 2020

Copy link to clipboard

Copied

While I am about it, here is an example of a setting with a parameter/value:

 

 

exposureCRF(expValue = 1.000000); // +1

function exposureCRF() {
  // Camera Raw Filter - Exposure
    var desc1 = new ActionDescriptor();
    desc1.putDouble(charIDToTypeID('Ex12'), expValue); // Variable 
    executeAction(stringIDToTypeID('Adobe Camera Raw Filter'), desc1, DialogModes.NO);
}

 

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 04, 2022 May 04, 2022

Copy link to clipboard

Copied

s.jpgScrip to Smart Object Layer Edit  Camera Raw Filter

// =======================================================
var idsetd = charIDToTypeID( "setd" );
var desc44 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref13 = new ActionReference();
var idfilterFX = stringIDToTypeID( "filterFX" );
ref13.putIndex( idfilterFX, 1 );
var idLyr = charIDToTypeID( "Lyr " );
var idOrdn = charIDToTypeID( "Ordn" );
var idTrgt = charIDToTypeID( "Trgt" );
ref13.putEnumerated( idLyr, idOrdn, idTrgt );
desc44.putReference( idnull, ref13 );
var idfilterFX = stringIDToTypeID( "filterFX" );
var desc45 = new ActionDescriptor();
var idFltr = charIDToTypeID( "Fltr" );
var desc46 = new ActionDescriptor();
var idCrVe = charIDToTypeID( "CrVe" );
desc46.putString( idCrVe, """14.2""" );
var idPrVN = charIDToTypeID( "PrVN" );
desc46.putInteger( idPrVN, 5 );
var idPrVe = charIDToTypeID( "PrVe" );
desc46.putInteger( idPrVe, 184549376 );
var idWBal = charIDToTypeID( "WBal" );
var idWBal = charIDToTypeID( "WBal" );
var idCst = charIDToTypeID( "Cst " );
desc46.putEnumerated( idWBal, idWBal, idCst );
var idTemp = charIDToTypeID( "Temp" );
desc46.putInteger( idTemp);
var idTint = charIDToTypeID( "Tint" );
desc46.putInteger( idTint);
var idExonetwo = charIDToTypeID( "Ex12" );
desc46.putDouble( idExonetwo, -0.950000 );
var idAdobeCameraRawFilter = stringIDToTypeID( "Adobe Camera Raw Filter" );
desc45.putObject( idFltr, idAdobeCameraRawFilter, desc46 );
var idfilterFX = stringIDToTypeID( "filterFX" );
desc44.putObject( idfilterFX, idfilterFX, desc45 );
executeAction( idsetd, desc44, DialogModes.NO );

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 04, 2022 May 04, 2022

Copy link to clipboard

Copied

executeAction( idsetd, desc44, DialogModes.ALL );

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 04, 2022 May 04, 2022

Copy link to clipboard

Copied

This code won't work until you use some temp and tint values.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 04, 2022 May 04, 2022

Copy link to clipboard

Copied

Give me sound advice on what to do

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 04, 2022 May 04, 2022

Copy link to clipboard

Copied

First of all I don't understand why you posted unworking code.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 04, 2022 May 04, 2022

Copy link to clipboard

Copied

Sorry sr

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 04, 2022 May 04, 2022

Copy link to clipboard

Copied

desc46.putInteger(idTemp, 1)
desc46.putInteger(idTint, 1)

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 04, 2022 May 04, 2022

Copy link to clipboard

Copied

When I run the script, the previous setting changes. I want to open the previous setting. Edit smart Filter

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 04, 2022 May 04, 2022

Copy link to clipboard

Copied

'This movie is private'

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 05, 2022 May 05, 2022

Copy link to clipboard

Copied

No Sr

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 05, 2022 May 05, 2022

Copy link to clipboard

Copied

It wasn't public. Now it is for some reason.

 

sTT = stringIDToTypeID;
(ref = new ActionReference())
.putIndex(fx = sTT('filterFX'), 1)
ref.putEnumerated(sTT('layer'), '', sTT('targetEnum'));
(dsc = new ActionDescriptor()).putReference(sTT('null'), ref);
dsc.putObject(fx, '', new ActionDescriptor())
executeAction(sTT('set'),
dsc, DialogModes.ALL)

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 05, 2022 May 05, 2022

Copy link to clipboard

Copied

Thanks sr

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 11, 2020 May 11, 2020

Copy link to clipboard

Copied

Stephen_A_Marsh
That was exactly what i'm looking for... thank you for your quick response!
 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
May 11, 2020 May 11, 2020

Copy link to clipboard

Copied

No worries, happy to make a minor contribution based on the work of zero3s and r-bin!

 

P.S. Just keep in mind that this is for rendered images using the Camera Raw Filter, which is not the same thing as a raw camera image file processed via Adobe Camera Raw.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 11, 2020 May 11, 2020

Copy link to clipboard

Copied

I'll understand...

 

The script is used to automate the following steps: Open TIFF - Filter - Camera Raw Filter - Auto -Ok

 

Last question: What's the difference between the 2 scripts you posted?

 

Thanks again

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
May 11, 2020 May 11, 2020

Copy link to clipboard

Copied

 

try {
    var d = new ActionDescriptor();
    d.putBoolean(stringIDToTypeID("dontRecord"), false);
    d.putBoolean(stringIDToTypeID("forceNotify"), true);
    d.putPath(stringIDToTypeID("null"), new File("/c/000/DSC_3030.NEF")); // your raw file
    var d1 = new ActionDescriptor();

    d1.putBoolean(charIDToTypeID("AuTn"), true);

    d1.putEnumerated(stringIDToTypeID("colorSpace"), stringIDToTypeID("colorSpace"), stringIDToTypeID("sRGB"));
    d1.putEnumerated(stringIDToTypeID("bitDepth"), stringIDToTypeID("bitDepth"), stringIDToTypeID("bitDepth8"));
    d1.putDouble(stringIDToTypeID("resolution"), 300);

    d.putObject(stringIDToTypeID("as"), stringIDToTypeID("Adobe Camera Raw"), d1);

    d.putDouble(stringIDToTypeID("overrideOpen"), true);
    d.putBoolean(stringIDToTypeID("smartObject"), true);

    executeAction(stringIDToTypeID("open"), d, DialogModes.ALL); // ALL - for dialog to control, NO - silent
    }
catch (e) { throw(e); }

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
May 12, 2020 May 12, 2020

Copy link to clipboard

Copied

"Last question: What's the difference between the 2 scripts you posted?"

 

The first script is a "self-invoking" function, it does not need to be called, it executes when parsed by the JS interpreter.

 

The second script is a "declared" function, it has to be "called" or executed using the declared function name.

 

As a beginner, I am just starting to learn through trial and error some of the basics when it comes to functions!

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
May 14, 2020 May 14, 2020

Copy link to clipboard

Copied

Is it possible to get the values from the camera raw filter if you have applied it to a smartobject?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
May 06, 2022 May 06, 2022

Copy link to clipboard

Copied

There may be new insights...

 

So the question again:

(How) is it possible to read certain values of the raw filter (applied to a smart object) - e.g. Temperature or Tint?

 

If that doesn't work directly, then maybe by temporarily saving it as a preset (xml) and reading out the desired value?

 

Thanks in advance for your help 🙂

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines