Cancelling Running Loop

This is bad programming. Event scripts run on the single GUI thread and must execute very quickly. A tenth of a second or less is a good, long-standing rule of thumb. If you have a script that is expected to take longer, particularly anything that includes a request across the network, you should use system.util.invokeAsynchronous() to place it in its own thread. There are restrictions on what such a background thread can do, though. You might find this topic helpful:

3 Likes