Hello all,
I’d like the ability to open a layer style dialog where my second inner shadow effect on a layer is selected by default, like this:
Here is my batch play code so far to get it to open with the two inner shadow effects, first one selected by default:
const editInnerShadow = async (innerShadow) => {
await core.executeAsModal(async function () {
let result = await action.batchPlay([{
_obj: "get",
_target: [
{ _ref: "property", _property: "layerEffects" },
{ _ref: "layer", _id: innerShadowLayer.id },
],
options: { dialogOptions: "dontDisplay" },
}], {});
return action.batchPlay([{
descriptor: {
_obj: "set",
_target: [
{ _property: "layerEffects", _ref: "property" },
{ _ref: "layer", _id: innerShadowLayer.id },
],
to: {
_obj: "layerEffects",
innerShadowMulti: result[0].layerEffects.innerShadowMulti
},
},
options: { dialogOptions: "display" },
}], {});
}, {"commandName": "Edit inner shadow."});
}
Any thoughts on how I can modify the above code to get the desired result? I was hoping I could use an ‘index’ property or something to tell the dialog which inner shadow effect I want opened by default.
Thank you!
Tim