evalFile currently runs script files using ExtendScript's $.evalFile.
However, $.evalFile sometimes throws an obscure error: "Can not convert to".
This appears to be a bug in $.evalFile. I found that the same problematic file does not cause the error if you read its contents with Node.js fs.readFileSync and pass the text to csi.evalScript.
For this reason, I suggest changing evalFile to use csi.evalScript (by reading the file with fs and passing the contents) instead of calling $.evalFile.
evalFilecurrently runs script files using ExtendScript's$.evalFile.However,
$.evalFilesometimes throws an obscure error: "Can not convert to".This appears to be a bug in
$.evalFile. I found that the same problematic file does not cause the error if you read its contents with Node.jsfs.readFileSyncand pass the text tocsi.evalScript.For this reason, I suggest changing
evalFileto usecsi.evalScript(by reading the file with fs and passing the contents) instead of calling$.evalFile.