cep-starter icon indicating copy to clipboard operation
cep-starter copied to clipboard

Once the jsx code error can not be executed again

Open sumhah opened this issue 8 years ago • 1 comments

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

sumhah avatar Jan 13 '18 11:01 sumhah

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)
})

vespakoen avatar Feb 28 '18 00:02 vespakoen