I tried duplicating the active document with
app.activeDocument.duplicate("Name")
and with batchplay
async function duplicateDoc() {
let docID = app.activeDocument._id
let docName = "name"
await exeModal(async function () {
await batchPlay(
[
{
_obj: "newDocument",
documentID: docID,
_options: {}
},
{
_obj: "duplicate",
_target: [
{
_ref: "document",
_enum: "ordinal",
_value: "first"
}
],
name: docName,
documentID: docID,
_options: {}
}
],{});
});
}
what i’m getting out of Alchemist does not appear logical to me as i would expect the new document not to have the ID of the source document. But i may be wrong here.
However, when i let batchplay display dialogs, it would throw a “command not available”. A try/catch(e) somehow gives me nothing.
Maybe i’m missing something?