I would like to get the ID of the new layer generated by sending a “mergeVisible” command to batchPlay. I was hoping that would be in the promise object returned from batchPlay, but I can’t figure out how to do anything with that promise object.
const mergeVisible = async (newLayername) => {
return executeAsModal( async () => {
command = [
{
_obj: "mergeVisible",
duplicate: true,
_options: {
dialogOptions: "dontDisplay"
}
}
]
const result = await batchPlay(command,{})
console.log("mergeVisible result: ",result)
}, { commandName: "mergeVisible" })
.then(res => console.log("mergeVisible success"))
.catch(err => {
throw new Error("Error mergeVisible: ", err)
});
}