I have a network share that I need connected at all times on my Mac. The problem is that every time I restart my machine, I’m greeted with an error message saying it had trouble connecting to the share, even though I have it set up under Login Items.

The issue comes down to timing. Login Items try to connect before the network is fully available after a reboot, so the mount fails.

This is where automation comes into play. I chose to work with Automator, a built-in macOS application that allows users to create workflows and applications without writing code.

Creating the Application

I created an Automator application that waits for the network to stabilize before attempting to mount the share.

  1. Open Automator and choose Application as the document type

  2. Add a Pause action and set it to 10-15 seconds

  3. Add a Run AppleScript action with the following code:

    try mount volume “smb://server/sharename” on error delay 5 mount volume “smb://server/sharename” end try

Replace smb://server/sharename with your actual share path. If you’re not sure what it is, connect to the share manually, then in Finder select the mounted share and press Cmd+I : the path will be shown under “Server.”

  1. Save the application to your Applications folder

Adding to Login Items

  1. Open System Settings → General → Login Items

  2. Click the + under “Open at Login”

  3. Select the Automator application you just created

Now when my Mac restarts, the Automator app launches, waits for the network to come up, and mounts the share automatically.