Greetings… I am a relativiely new user here, been lurking for a
few months. I always find this board useful, and heretofore
answers for all my questions could easily be found in the
archives.
But! I have been un-able to find any decent documentation
on how the script menu works… so here’s my questions:
is there any way to halt (or otherwise control) script execution
from the script menu? My problem is that I have one script
that I often inadvertently start at the wrong time, and when
that happens I’d like to stop it before it modifies a bunch
of files and stuff.
i am working on a script that seems to work perfect in
the directory i composed it in, but it doesn’t seem to work
once i move it to the scripts folder (and hence to the menu).
any suggestions?
thanks.
Model: powerbook G4
Browser: Safari 312.5
Operating System: Mac OS X (10.3.9)
A script, once running, can only be stopped if you’ve made provision to stop it in the script itself. Several possibilities:
Put a dialog at the front end:
display dialog "Proceed with this Script?" buttons {"Cancel", "Proceed"}
-- your code
This will quit if “Cancel” is selected, and run the script if Proceed is selected - no test is required.
Save the script as an application. It will appear in the dock and you can quit it there.
The difficulty is almost certainly a path problem. When the script is in the directory it refers to, it works, but from the ~/Library/Scripts folder it doesn’t know where the original directory is. Can’t say more without seeing the script.