JSX method/function does not execute in Illustrator
I have done this before and for the life of me I can't get why it's not working this time around.
I create two variables which have the root path and file to a jsx script:
const root = decodeURI(csiRun.getSystemPath("extension")).replace(/file\:\/{1,}/, "");
const createArtBuild = `${root}/jsx/buildArt.jsx`;
Inside of buildArt.jsx I have a function with alert:
function buildArtwork() {
alert('this is running')
}
I then evaluate the file and run the method:
csiRun.evalScript(`$.evalFile('${createArtBuild}')`);
// execucte jsx in illustrator
csiRun.evalScript(`buildArtwork(${'test'})`, async (returnVal) => {
console.log('this hit?')
})
I do get console.log "this hit" but the function never alerts.
I've set the correct settings in terminal for the CEP.
defaults write com.adobe.CSXS.11 PlayerDebugMode 1
Any idea what I'm doing wrong?
