The Apple Script repeats every minute when saved as an application and the box is checked as "stay open after run handler". I used this method to convert it to Shell Script: How do I convert this Applescript to Terminal osascript? , but it won't repeat as it does in the Apple Script. However it will work without the idle commands, but of course, it doesn't repeat. How do I get it to work? Is there a better syntax to use to have it repeat than #idle, #return 60 #end idle?
Apple Script
on idle
tell application "Finder"
if not (disk "Backup_Server" exists) then
display alert "Backup_Server not found, please mount"
end if
delay 5
if not (disk "Backup_Server" exists) then
display alert "Backup_Server still not found, please submit a ticket"
return 60
end if
end tell
end idle
on quit
continue quit
end quit
Shell Script
#!/usr/bin/osascript
on idle
tell application "Finder"
if not (disk "Backup_Server" exists) then
display alert "Backup_Server not found, please mount"
end if
delay 5
if not (disk "Backup_Server" exists) then
display alert "Backup_Server still not found, please submit a ticket"
return 60
end if
end tell
end idle
on quit
continue quit
end quit