I’m trying to open one file after another in a loop and afterwards have a function processing them, but they seem to be opened all at the same time although I use “await”. What could that be?
Here’s the code …
filearray.forEach(async function(file) {
try {
await app.open(file);
let docRef = app.activeDocument;
await docRef.flatten();
await someFunction();
} catch (error) {
console.log("File open error.")
}