What is the difference between app.doScript and $.evalFile?

可紊 提交于 2019-12-03 13:28:20

$.evalFile is an ExtendScript feature while app.doScript is implemented by InDesign.

$.evalFile does

  • maintain the $.stack
  • consider $.includePath
  • work in other target applications

app.doScript can

  • pass arguments
  • change the language, e.g. AppleScript
  • use #targetengine to address other sessions
  • modify the undo/transaction mode as far as supported

but ...

  • nested doScript calls overwrite arguments
  • in a complicated setup I had trouble to debug after passing more than 12 arguments.
  • single stepping across doScript is trouble

Also, as you found, error handling differs. Keep an eye on exceptions ...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!