使用 AppleScript 时,我发现当你构建一个repeat
以递增一个块时,如果你取消它,你必须关闭脚本才能重新开始:
property foobar : 0
tell application "BBEdit"
activate
select insertion point before first character of text document 1
repeat
## some magic
end repeat
end tell
有没有办法取消你可以property
在脚本中将 back 重置为 0 以便它可以再次重新运行?此外,当重复循环运行并完成时,您仍然必须关闭脚本才能重新运行它,即使在foobar
使用set foobar to 0
. 研究没有显示任何关于 Apple.se、SO、超级用户或 Apple 讨论的内容。如何在不关闭脚本的情况下重置脚本?