I’m getting the following error message whenever I play an action that has steps that include recorded button clicks from UXP plugins
This is only happening in Ps Beta v25.9.0. It does NOT happen with the current product version of Ps (v25.7.0). I have replicated the errors on Windows 10 and an older MacBook Air computer running the Monterey OS (Intel chip).
I thought it might be another plugin causing this problem, so I removed all installed plugins.
The “Test BUtton” plugin is being run from UDT and I have removed all batchPlay from it except for the one button I’m using to try and understand where this error is coming from.
The HTML for the button I’m using is:
<sp-button id="buttonACTIONFROMUXP">Acton from UXP</sp-button>
The JS is as follows:
document.getElementById("buttonACTIONFROMUXP").addEventListener("click", async() => {
try {
// record function as an action and pass required variables.
action.recordAction(
{"name": "New Layer", "methodName": "myNewLayer"}, {"MyLayerName": "New Layer from action", "historyStateName": "Run My Action"}
);
} catch (e) {}
//Run the action associated with the button when the button is clicked and pass the necessary variables
//First variable is an empty object but could potentially be: {"mode":"action","uiMode":"never","hostControl":{}}
await myNewLayer({"uiMode":"test"}, {"MyLayerName": "New Layer from click", "historyStateName": "New Layer From Click"});
});
//adding function in global scope.
window.myNewLayer = myNewLayer;
async function myNewLayer(executionContext, info) {
try {await exeModal(targetFunction, {"commandName": "Progress...", "interactive": true});}
catch(e) {
if (e.number == 9) {showAlert("Some other plugin is using Photoshop!");}
else {
//THIS IS WHERE THE ERROR MESSAGE IS BEING GENERATED!
showAlert(e)
}
}
async function targetFunction(executionControl, string) {
let hostControl = executionControl.hostControl;
let documentID = await app.activeDocument._id;
let suspensionID = await hostControl.suspendHistory({ "historyStateInfo": { "name": info.historyStateName, "target": [{ _ref: "document", _id: documentID }] } });
///////////////////// Start modal execution /////////////////////
await batchPlay([
//Make new layer
{ "_obj": "make", "_target": [ { "_ref": "layer" } ]},
], {}).then(result => {console.log(result)}, error => {console.log(error)});
///////////////////// Stop modal execution /////////////////////
await hostControl.resumeHistory(suspensionID);
} // end targetFunction()
};
I have one beta tester using a Mac Apple Silicon computer and he cannot replicate this issue.
I’m completely mystified. I’ve been experimenting extensively with creating and playing actions from UXP button clicks, and everything was working fine with all my plugins until this started.
I’ve reset my Ps Beta preferences, but that did not help either.
Has anyone else had a similar experience? Does anyone have any idea what might be causing this?