Once the jsx code error can not be executed again
If the jsx code error, the script does not take effect after the change, i must restart photoshop, reopen the cep expansion in order to properly execute the script.
E.g:
if i run this code:
console.log(app.activeDocument.activeLayer.textItem.contents)
jsx code can not be executed again after the next change
I think this has to do with Photoshop, I haven't experienced this in After Effects, You could try catching all errors and logging them to the console, you can copy the code from here:
https://github.com/adobe-extension-tools/extendscript-starter/blob/03588dfb78c836ad0c02a5e36937d368d6528171/src/AfterEffects/core/utils.ts#L1-L25
and here:
https://github.com/adobe-extension-tools/extendscript-starter/blob/03588dfb78c836ad0c02a5e36937d368d6528171/src/AfterEffects/core/utils.ts#L74-L83
Then use it like this:
catchErrors(() => {
console.log(app.activeDocument.activeLayer.textItem.contents)
})