Extendscript Toolkit 没有在断点处停止,为什么?
我正在使用 Extendscript Toolkit 编写 Illustrator CS5 脚本。
我在代码中设置了几个断点,它们在行号旁边显示为红点。但是当我运行脚本时,它一直执行到最后而不停止,并且断点点变暗。
我在这里缺少什么?
谢谢!
I am scripting Illustrator CS5 with the Extendscript Toolkit.
I set several breakpoints in my code, they show up as red dots next to the line number. But when I run the script, it executes all the way to the end without stopping and the breakpoint dots turn dark.
What am I missing here?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
检查以确保
$.level
未在代码或应用的启动脚本中的某个位置设置。如果$.level
设置为0
或1
,则断点被禁用。您还可以尝试在代码开头显式设置$.level=2
,以确保断点已打开。Check to make sure
$.level
isn't set somewhere, either in your code or the app's startup script. If$.level
is set to0
or1
, breakpoints are disabled. You might also try explictly setting$.level=2
at the start of your code, to ensure breakpoints are turned on.这是 ESTK(Extendscript Toolkit)中的一个常见错误,我相信这是一个错误 - 断点不应通过启动脚本来禁用。
最有可能的是按 F11(步入)也会使断点变成深红色(禁用)。但在这种状态下(单步执行代码),您可以再次启用断点,当您让脚本运行(F5)时,断点将会被命中。
(快捷方式适用于 Windows 版本。)
另一件事是首先从 InDesign 中的脚本面板启动脚本(运行一次),然后从 ESTK 启动它。如果您使用 targetengine 指令来设置特定的引擎名称,这甚至可能是必要的。
This is a common error in the ESTK (Extendscript Toolkit), I believe it's a bug - breakpoints should not get disabled by starting the script.
Most likely pressing F11 (step into) will also make the breakpoints turn into a darker red colour (disabled). But in this state (stepping through the code) you can enable the breakpoints again and they will get hit when you let the script run on (F5).
(Shortcuts are for the Windows version.)
Another thing to try is to first start the script from the scripts panel in InDesign (run it once), and then start it from the ESTK. If you use the targetengine directive to set a specific engine name, this might even be necessary.