Loading network driver at boot/login

This is one of the macros I haven’t been able to make it work reliably, so any help will be much appreciated.

I am using a Synology NAS and I’d like to mount one of the drives automatically when I’m at home. The problem is that I end up having the same volume mounted multiple times. Which based on my logic is almost impossible except the case that multiple trigger events would happen simultaneously.

For this I’ve created a macro with the following triggers:

  1. at login
  2. at system wake
  3. wireless network is connected
  4. hourly between 5am - 2am

In the actions:

  1. I test that the following conditions are all met:

    1. the volume is not mounted yet
    2. the wireless network is connected
  2. if these conditions are passing then execute some AppleScript ignoring the results

     tell application "Finder"
         try
             mount volume "..."
         end try
     end tell
    

Questions:

  1. should I reduce the number of triggers?
  2. what triggers could work better?
  3. are there other conditions I should be checking for?

tia

You will probably get the system wake and wireless network connected triggers both when you wake, so that would definitely happen at the same time.

You could add a Semaphore Lock action to the start of the macro, that is what they are designed for.

So you could probably do:

  • Semaphore Lock “Mouse Volumes”
  • If mounted volume “Whatever” does not exist:
    • Execute AppleScript