Not sure where should i use this? It seems your function activates refresh only if there is an error? I forgot to add, that these smart objects are nested ( linked smart object inside embedded smart object), could this be an issue? What i want the script to do. 1. Loop through all layers 2. If a layer is a smart object, open that smart object > update modified content > save and close. What my script currently does: 1. Loops through layers. 2. First 8(for example) smart objects are opened, updated and closed correctly, but since the 9th is a bigger document, Photoshop does not get it open before the loop already tries to save it. this causes the script to save and close the main file. if i use activeDocument = doc; instead of app.activeDocument.close(SaveOptions.SAVECHANGES); the script manages to update the first 8 objects and manages to open all the others, but not update them.
... View more