Stop a running AppleScript

How can I stop a running AppleScript file (.scpt), using something like “killall application”?

Hello.

As long as the script is in the foreground, your safest bet is “Command .”. By all means, if your script is run by AppleScript runner, then you may invoke

. But this only works with scripts that are run by AppleScript runner. A lot of programs has their own script runner. My favourite is FastScripts, which has a menu item named abort script. -Which works perfectly. Fastscripts is free, as long as you are satisfied with 12-14 keyboard short cuts. :slight_smile:

Hi,

Here’s another way with Applescript:

tell application "AppleScript Runner" to quit

This will stop all the scripts. The AppleScript Runner is not very scriptable.

One thing I noticed is when you run a second script, the first one stops! Is this supposed to happen?

So, If this is normal that the AS Runner only runs one script, then you can stop it with another script. Something like this:

say "stopping script" without waiting until completion

You can put it in the Script Menu.

gl,
kel

Hello.
If Applescript runner stops a running a script, when executing the other, then that is a feature, if you don’t use AppleScript runner in your own scripts. :slight_smile: If you do use AppleScript runner in your own scripts, then I also really recommend the Fast Scripts Menu, that not only let your code pass by unobtrused, but also be executed faster. :slight_smile:

That’s true. I looked at the dictionary and it says that you can run scripts. Now I need to try it and see if running another script stops the first script. :slight_smile: McUsr, you’re making me work here. :slight_smile:

Have a good day,
kel

When I run a script in the AS Editor and then run a script from the Scripts Menu, the first script stops with an error in the AS Editor.