RosettaCodeData/Task/Program-termination/AppleScript/program-termination-2.applescript

10 lines
431 B
AppleScript
Raw Normal View History

2023-07-01 11:58:00 -04:00
on idle -- A stay-open applet's 'idle' handler is called periodically while the applet remains open.
-- Some code, including:
if (someCondition) then
quit -- Quit the applet when the script stops executing.
error number -128 -- Stop executing the script. (Not necessary on recent systems.)
end if
return 10 -- Number of seconds to the next call of this handler if the applet's still open.
end idle