Ok, I’m having one heck of a time with this, and while I’ve hesitated to ask, I’m going on nearly 1 full day trying to figure this out. I can get consoles, but when I try to use the value I get Promise {: undefined}.
//get layer itemIndex
async function itmIdx() {
const getIndex = await batchPlay(
[{
_obj: "get",
_target: [
{
_property: "itemIndex"
},
{
_ref: "layer",
_name: "Pen Out"
}
],
_options: {
dialogOptions: "dontDisplay"
}
}
], {});
const value = getIndex[0].itemIndex - 1;
console.log(value);
}
let idx = itmIdx();
//Move Layer Pen Out to itemIndex
const penOut = async () => {
await batchPlay([
console.log(idx)
], {})
}
My goal is to use the value to move a layer into a layer folder. using -1. However I’m getting no where when dropping idx into the obj “move”, _index: idx