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

Using Javascript with Photoshop to 'Update all modified content'

Community Beginner ,
Jan 22, 2021 Jan 22, 2021

Before I start I offer my apologies if this has been asked before, but I've searched the comminity without finding this particular question listed anywhere.

I'm using Javascript to automate merging some Photoshop documents. As part of the process one document includes a smart object and I would like to use Javascript to 'force' that smart object to update before the merge takes place. In the Photoshop interface I can do this manually by right clicking on the object and selecting 'Update All Modified Content' from the pop up menu, but I can't seem to find a way to do this using Javascript. Thanks in advance to anyone who can offer me a pointer.

TOPICS
Actions and scripting
1.0K
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 23, 2021 Jan 23, 2021

Not all features are available using the standard DOM code found in the JavaScript guide. Sometimes you have to use ScriptingListener plugin recordings. 

 

Raw ScriptingListener code:

 

 

 

var idplacedLayerUpdateAllModified = stringIDToTypeID( "placedLayerUpdateAllModified" );
executeAction(idplacedLayerUpdateAllModified, undefined, DialogModes.NO);

 

 

 

Previous code passed through Clean SL as a named function and call:

 

 

 

placedLayerUpdateAllModified();

function placedLayerUpdateAllModif
...
Translate
Adobe
Community Expert ,
Jan 23, 2021 Jan 23, 2021

Not all features are available using the standard DOM code found in the JavaScript guide. Sometimes you have to use ScriptingListener plugin recordings. 

 

Raw ScriptingListener code:

 

 

 

var idplacedLayerUpdateAllModified = stringIDToTypeID( "placedLayerUpdateAllModified" );
executeAction(idplacedLayerUpdateAllModified, undefined, DialogModes.NO);

 

 

 

Previous code passed through Clean SL as a named function and call:

 

 

 

placedLayerUpdateAllModified();

function placedLayerUpdateAllModified() {
	var s2t = function (s) {
		return app.stringIDToTypeID(s);
	};
	executeAction(s2t( "placedLayerUpdateAllModified" ), undefined, DialogModes.NO);
}

 

 

 

Simple one-liner:

 

 

 

app.runMenuItem(stringIDToTypeID("placedLayerUpdateAllModified"));

 

 

 

You can of course go deeper, this is just the basics.

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 Beginner ,
Jan 23, 2021 Jan 23, 2021
LATEST

Stephen_A_Marsh you are a champion. This answer would have taken a lot of time to find by myself so I'm grateful for you sharing the knowledge. Who would have guessed that there was a scripting listener? Makes sense when I think about it though... Now I have another rabbit hole to follow 🙂 Cheers!

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