Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
1

Camera Raw Filter defaults to previous edits when called from action

Engaged ,
Nov 08, 2024 Nov 08, 2024

When called from an Action, Camera Raw Filter applies the masks and the swatches in Color Mixer (and probably others I haven’t used/noticed) that were used the last time it was thus called … even when other images have been processed through ACR in the meantime.

 

An example is attached, where the mask applied to a previous image (about 10 images ago) can be clearly seen.

TOPICS
Actions and scripting , Windows
4.7K
Translate
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 1 Correct answer

Community Expert , Jan 30, 2025 Jan 30, 2025
quote

I get a syntax error executing that in Visual Studio Code (within a test program I have).  I tried running the entire code sequence of the call (copied from ScriptListener) and that gave a syntax error too.  Mystifying!


By @FitzFoto

 

Works for me when executed in Photoshop.

 

You can also try this:

 

try {
    executeAction(stringIDToTypeID("Adobe Camera Raw Filter"), undefined, DialogModes.ALL);
} catch (error) { 
    //alert("Error!" + "\r" + error + "\r" + 'Line: ' + error.line);
}

 

Translate
Adobe
Community Expert ,
Jan 26, 2025 Jan 26, 2025

A work-around could be to record the Camera Raw Filter, deleting the Smart Filter and then using »insert Menu Item« Camera Raw Filter. 

That seems to hose the obsolete settings, but deleting Smart Filters would naturaly be a problem if the Smart Object already had other Smart Filters applied. 

Screenshot 2025-01-27 at 08.55.34.png

Translate
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
Engaged ,
Jan 27, 2025 Jan 27, 2025

That didn't work.

 

The Action just obeyed the second CRF call without deleting the effect from the first.  If I put a Stop after the command it does delete it, and deletion does remove the mask/spot removal from the image opened in ACR.

 

I have a script which introduces a delay; I will call it after the Delete effects command and try with different durations, and will report back.

 

Translate
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
Engaged ,
Jan 27, 2025 Jan 27, 2025

UPDATE

 

The delay (up to 5s) made a difference, but not the one expected.

 

ACR was called, I created a mask and dramatically altered the exposure, then exited ACR back to the Action.  The Action paused for 5s but did not delete the effect.  After 5s ACR was called again and of course the mask was still there.  Returning to the Action from ACR caused the Delete effect comand preceeding the CRF call to be executed and the effect was deleted.

 

Sorry, but that is unworkable.

 

@Sameer K @D Fosse  for info.

Translate
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 Expert ,
Jan 27, 2025 Jan 27, 2025

What did you do in the first, the recorded Filter-application? 

Could you post a screenshot of the fully expanded Action? 

Translate
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
Engaged ,
Jan 28, 2025 Jan 28, 2025

To be completely clear again, I did not record any filter application in the Action.

 

The Action was built from a default Action I have that duplicates a layer, adds a mask, adds a colour to the layer entry, etc.  The call to the CRF was inserted using the 'Insert Menu Item ...' command in the Actions fly-out menu.  This does not call the CRF at the time of insertion.

 

A screenshot of the Action is attached.  Note that the commands inserted to test your idea and to introduce a delay are not active atm.

Translate
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 Expert ,
Jan 28, 2025 Jan 28, 2025

The work-around I mentioned is to record the Filter without any actual edits, remove that and invoke the Filter via »Insert Menu Item«. 

Screenshot 2025-01-28 at 13.42.03.png

Translate
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
Engaged ,
Jan 28, 2025 Jan 28, 2025

I tried that, it had no effect.  The second call to CRF opened ACR and added a new filter to the existing Smart Object (the previous filter having been deleted, BUT the mask remained in ACR and was applied, with the desaturation edit used to check the result).  Having to intervene to close ACR to enable the Action to continue is interruptive of my workflow, so I will not pursue that route.

Translate
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 Expert ,
Jan 29, 2025 Jan 29, 2025

Does this raise the dialog without applying the pervious edits? 

// 2025, use it at your own risk;
if (app.documents.length > 0) {
try {
var desc6 = new ActionDescriptor();
desc6.putInteger( charIDToTypeID( "PrVN" ), 6 );
executeAction( stringIDToTypeID( "Adobe Camera Raw Filter" ), desc6, DialogModes.ALL );
} catch (e) {}
};
Translate
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
Engaged ,
Jan 30, 2025 Jan 30, 2025

I get a syntax error executing that in Visual Studio Code (within a test program I have).  I tried running the entire code sequence of the call (copied from ScriptListener) and that gave a syntax error too.  Mystifying!

Translate
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 Expert ,
Jan 30, 2025 Jan 30, 2025
quote

I get a syntax error executing that in Visual Studio Code (within a test program I have).  I tried running the entire code sequence of the call (copied from ScriptListener) and that gave a syntax error too.  Mystifying!


By @FitzFoto

 

Works for me when executed in Photoshop.

 

You can also try this:

 

try {
    executeAction(stringIDToTypeID("Adobe Camera Raw Filter"), undefined, DialogModes.ALL);
} catch (error) { 
    //alert("Error!" + "\r" + error + "\r" + 'Line: ' + error.line);
}

 

Translate
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
Engaged ,
Jan 31, 2025 Jan 31, 2025

I identified and resolved the issue.  It lay in a Function library that is loaded by default in all my scripts, but a rogue edit had corrupted a line.

 

With that fixed, the code worked.  It does not load ACR but apparently fixes the issues.

 

I will do some more testing before marking as the correct answer, but thank you very much.

Translate
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
Engaged ,
Feb 05, 2025 Feb 05, 2025

@c.pfaffenbichler 

 

I was incorrect.  Further testing showed it did not fix the error.  But I had not tested in in the Action.

 

Running the script in the Action just opens ACR with the mask (or whatever) that was applied previously.

 

I will continue along this road though and report back.

Translate
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 Expert ,
Feb 05, 2025 Feb 05, 2025

If the Script performs as intended, but not when started from an Action, I would recommend packing the whole Action’s operations into the Script and triggering that via a shortcut. 

Translate
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 Expert ,
Jan 30, 2025 Jan 30, 2025

Does the error also happen if you save it as a jsx-file and browse it from Photoshop (File > Scripts > Browse)? 

Translate
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
Engaged ,
Feb 10, 2025 Feb 10, 2025
LATEST

UPDATE: In somebody's immortal words: "The effect is undefined."

 

Sometimes ACR opens, sometimes not.  Sometime PS locks up, sometimes not (but more often it locks up).  And it appears immaterial to those situations whether I am running the script from the Action or from Visual Studio Pro.

 

But everytime ACR does open the previous settings are still there.

 

It appears that even a new initiation of ACR via the CRF menu item *in an Action* is treated as running the previous instance of the filter, but without simply applying the settings which is what happend if one clicks CRF at the top of the menu.

Translate
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 Expert ,
Jan 25, 2025 Jan 25, 2025

@FitzFoto , are you trying to apply specific Camera Raw settings or just trigger the Filter? 

Translate
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
Engaged ,
Jan 26, 2025 Jan 26, 2025

Just trigger the filter, plus creating a layer, adding a mask to that and adding a color attribute to the layer - all in the Action.  I specifically do not want any Camera Raw settings applied, hence why the 'carry-over' mask is an issue.

Translate
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