I have started to use the Alchemist Plugin by @Jarda mainly in the Listener Mode to try and get to grips with how this UXP stuff works but I have a question which is slightly bugging me.
Using Alchemist I have recorded 2 actions
1: Extend the document canvas
2: Duplicate the layer
In the Index.js I have made a function and added the generated code from the Extend Canvas Reordered Action.
function ExtendCanvas () {
const batchPlay = require(“photoshop”).action.batchPlay;
const result = batchPlay(
[
{
“_obj”: “canvasSize”,
“relative”: true,
“width”: {
“_unit”: “pixelsUnit”,
“_value”: 300
},
“height”: {
“_unit”: “pixelsUnit”,
“_value”: 300
},
“horizontal”: {
“_enum”: “horizontalLocation”,
“_value”: “center”
},
“vertical”: {
“_enum”: “verticalLocation”,
“_value”: “center”
},
“_isCommand”: true,
“_options”: {
“dialogOptions”: “dontDisplay”
}
}
],{
“synchronousExecution”: true,
“modalBehavior”: “fail”
});
}
The Generated code from the Duplicate Layer looks like this…
const batchPlay = require(“photoshop”).action.batchPlay;
const result = batchPlay(
[
{
“_obj”: “copyToLayer”,
“_isCommand”: true,
“_options”: {
“dialogOptions”: “dontDisplay”
}
}
],{
“synchronousExecution”: true,
“modalBehavior”: “fail”
});
Question:
How can I add the Duplicate Layer code to the Extend Canvas code so it runs them from the single ExtendCanvas () function.
Thanks
Ian