Copy link to clipboard
Copied
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.
1 Correct answer
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
...
Explore related tutorials & articles
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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!

