I’m trying to figure out how to check to see if a document is open, and if it is to make it the active one. I don’t know how to check the open documents titles to get their current _id. I can loop through them and check their title and this works, although ideally there is a better solution. Current code is below
async function testCode1() {
if (app.activeDocument.title != "3D_temp.tif") {
for (i = 0; i < app.documents.length; i++) {
app.activeDocument = app.documents[i]
if (app.activeDocument.title == "3D_temp.tif") {
return
}
}
}
}