First, thank you to Jarda for creating Alchemist. It has been a huge lifesaver without having the finished DOM API.
This is more of an FYI to help anyone out who runs across this. There are some commands that don’t record in Alchemist but still record with script listener. The new Transformation Reset for smart object and select Subject are 2 that come to mind but I’m pretty sure I saw a couple more as well. You can still use script listener in CC 2021 still to get the command and patch up a batchPlay descriptor.
For the new CC 2021 Reset Transform, this is the Alchemist output. It stops after the “invokeCommand”.
const batchPlay = require("photoshop").action.batchPlay;
const result = await batchPlay(
[
{
"_obj": "invokeCommand",
"commandID": 6347,
"kcanDispatchWhileModal": true,
"_isCommand": false,
"_options": {
"dialogOptions": "dontDisplay"
}
}
],{
"synchronousExecution": false,
"modalBehavior": "fail"
});
Here is the Script Listener output
// =======================================================
var idinvokeCommand = stringIDToTypeID( "invokeCommand" );
var desc28 = new ActionDescriptor();
var idcommandID = stringIDToTypeID( "commandID" );
desc28.putInteger( idcommandID, 6347 );
var idkcanDispatchWhileModal = stringIDToTypeID( "kcanDispatchWhileModal" );
desc28.putBoolean( idkcanDispatchWhileModal, true );
executeAction( idinvokeCommand, desc28, DialogModes.NO );
// =======================================================
var idhistoryStateChanged = stringIDToTypeID( "historyStateChanged" );
var desc29 = new ActionDescriptor();
var idDocI = charIDToTypeID( "DocI" );
desc29.putInteger( idDocI, 220 );
var idIdnt = charIDToTypeID( "Idnt" );
desc29.putInteger( idIdnt, 228 );
var idNm = charIDToTypeID( "Nm " );
desc29.putString( idNm, """Reset Transforms""" );
var idhasEnglish = stringIDToTypeID( "hasEnglish" );
desc29.putBoolean( idhasEnglish, true );
executeAction( idhistoryStateChanged, desc29, DialogModes.NO );
// =======================================================
var idplacedLayerResetTransforms = stringIDToTypeID( "placedLayerResetTransforms" );
executeAction( idplacedLayerResetTransforms, undefined, DialogModes.NO );
Here is the modified Alchemist batchPlay code the works for the new CC 2021 Reset Smart Object Transform. I omitted the “dialogOptions”: “dontDisplay” part based on the prior discussion in one of my posts. I’m not even sure what “_isCommand” does but it seems it doesn’t need that either.
const batchPlay = require("photoshop").action.batchPlay;
const result = await batchPlay(
[
{
"_obj": "placedLayerResetTransforms"
}
}
],{
"synchronousExecution": false,
"modalBehavior": "fail"
});
Anyway, just want to post this as FYI in case it may help someone who encounters the same thing with this command or another one that the script listener may hep with.