Check automatically if a drive is mounted
Ive always done mine based on user login. You would go to Users &amp; Groups click the current user go to Login Items hit the plus icon at the bottom and you can add it there. I built a similar application to detect my NAS and mount if not mounted:



Sample code, not tested:

on run
    tell application "System Events" to set theDisks to name of every disk
    set theNAS to "Shared" ## Change here to name
    set isMounted to false
    if theNAS is in theDisks then set isMounted to true
    if isMounted = false then mount volume "afp://" &amp; theNAS
end run


Some links to mounting:


How can I mount a volume in a network?
Automated volume mounts on mac


You could do through a LaunchAgent here are some resources:


Run a script at login for all users
Applescript Login Item for All Users
Launch login items for all users at startup


There are other approaches like a launchd but you will sacrifice RAM so it can check. I think at login would be your best approach.