Known Participant
August 26, 2022
Answered
Extendscript currentProject Unknown Exception Error
- August 26, 2022
- 1 reply
- 1362 views
In my script, I start by running this code lifted straight from the PPro Github:
var viewIDs = app.getProjectViewIDs();
for (var a = 0; a < app.projects.numProjects; a++) {
var currentProject = app.getProjectFromViewID(viewIDs[a]);
if (currentProject) {
if (currentProject.documentID === app.project.documentID) { // We're in the right project!
//here's where my actual script goes, but that doesn't really matter
}
}
}
Sometimes it'll work and script runs as intended, but many times it doens't run and when I do a debug I get an "Unknown error exception" on the line:
if (currentProject.documentID === app.project.documentID)
I've tried messing around and found that occasionally one of the currentProject will show up like the attached. Any idea why?
Thanks!
