Skip to main content
raxby
Inspiring
November 6, 2018
Answered

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

  • November 6, 2018
  • 3 replies
  • 10718 views

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);

})();

Correct answer r-bin

maybe this ?

 

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

 

3 replies

Participant
March 11, 2025

how to  camera raw previous settings apply with java script

Known Participant
October 30, 2019

Hello, I want to do batch processing of photos using "File > Scripts > Image Processor ..." that call a sting of Actions to tune the pictures with different exposure settings.

Amongst these Actions, I would record "Camera Raw Filter" click "Auto" so that the filter tuned the picture automatically.  However, I found that the Action recorded the "Camera Raw Filter" with absolute parameters applied to the model picture being recorded.  Then, when the Action is run, the Camera Raw Filter applied the same static parameters of the model picture to all other pictures in the batch.

Is there a way to make recording of "Camera Raw Filter" with click "Auto" to work, so that the pictures are tuned based on the Auto measurements applicable to the picture in work, instead of the static parameters relevant to the model picture.

 

{Thread renamed by moderator}

Sahil.Chawla
Adobe Employee
Adobe Employee
October 30, 2019

Hi Martin,

Welcome to the Adobe Community!

 

As you want to record Camera Raw's Auto as an action, please have a look at a similar discussion here: Batch Process Camera RAW Auto Correct I think the correct answer is what you're looking for.

Let us know how it goes.
Regards,
Sahil

Known Participant
October 30, 2019

Thank Sahil.

The link that you gave on the response attempted to resolve similar issue.  But, it does not resolve the problem that I have.

(In fact, maybe due to version upgrade, it now does not require Adobe Bridge to call the job of running Scripts of Image Processor.  As described on my post, the File Menu of Photoshop has included the menu item of Scripts > Image Processor.)

 

The problem is stemmed from the recording of "Camera Raw Filter".

To illustrate, I have 500 pictures which are taken at different spots, in-door and outdoor, throughout an event.  As a result, some of them are a bit over exposure and some are slightly under exposure.  In a manual process of Photoshop, I would open these 50 pictures one by one and apply Camera Raw Filter > Auto to correct them.  For convinence sake, I would not manually do exposure and other adjustments one by one, but rely on the Auto function of Camera Raw Filter.  Yet, it still take me a lot of time.

So, I tried to record my action steps into the Actions scripts and apply these action steps to the 500 pictures.

 

When I recorded the Action

I opened the first picture (Modelling Picture) and record the actions.  Amongst the actions, I invoked the Camera Raw Filter and  click "Auto" (Yellow Arrow on diagram), i.e. leave it to Photoshop to do automated adjustment.

I finished the recording and saved it to Action 1.

 

Then I runned the Image Processor with Action 1, 

Photoshop then went through the scripts of Action 1 and applied them all on the 500 pictures.

The effect was not good.  I realized that the Action 1 recorded the fixed value of adjustments based on the Modelling Picture, as noted on the below diagram.

As I said, some of the 500 pictures should be adjust +EV and some others -EV, I wanted to apply Auto of Camera Raw Filter.  (I do not want because of the Modelling Picture required +EV then the rest pictures applied +EV.)  The required adjustments are not just exposure but other elements. 

Would there be a way to set such scripts up?

 

 

 

   

 
 

 

Legend
November 6, 2018

Try

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

raxby
raxbyAuthor
Inspiring
November 7, 2018

Thank you very much. You are right.

Participant
May 10, 2020

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.