UXP script Photoshop GET
Please help, I'm trying to find out the currently selected action. The GET function does not work.
async function getSelectedAction() {
const batchPlay = require('photoshop').action.batchPlay;
const result = await batchPlay(
[
{
"_obj": "get",
"_target": [
{
"_property": "property"
},
{
"_ref": "action",
"_name": "selected"
}
],
"_options": {
"dialogOptions": "dontDisplay"
}
}
],
{
"synchronousExecution": true
}
);
const selectedAction = {
actionSetName: result[0].actionSet._name,
actionName: result[0].action._name
};
return selectedAction;
}
(async () => {
try {
const selectedAction = await getSelectedAction();
console.log('Selected action:', selectedAction);
} catch (error) {
console.error('Error:', error);
}
})();
