Given an AppleScript file designed to poll for an application dialog box every 30 seconds, how can I easily setup my Mac OS so that this AppleScript file starts every time I login silently in the background?
Code for the script ( in case interested ) is listed below, and is designed to click "Later" on the AirMail Beta app:
repeat if (exists application "AirMail Beta") then tell application "System Events" to tell process "Airmail Beta" if exists (button "Later" of front window) then click (button "Later" of front window) end if end tell end if delay 30 end repeat
The above script works, but if anyone can think of a better way to auto-click a dialog without writing an AppleScript that polls every few seconds, feel free to offer such a solution in comments. Mainly though, I'd like to know the best way to manage AppleScripts designed to run continuously so they can be enabled / disabled and startup without being seen at login automatically.