Automator - Connect to Server at Startup based on MAC Address I've spent half of my day yesterday trying to figure this out, so I thought it may be useful for someone else in the same situation.
I wanted to automatically Connect to a Server at Startup but not based on the IP Address, but based on the MAC address of my device. This was needed because I change routers from time to time and this change gives a new IP Address to my server device.
The solution was to add a short shell script in the Automator application to get the IP address based on the MAC address.
ip_address=$(arp -a | grep &quot;YOUR_MAC_ADDRESS&quot; | cut -d &quot;(&quot; -f2 | cut -d &quot;)&quot; -f1)

url_beginning=&quot;afp://&quot;

url_end=&quot;/YOUR_USER_NAME&quot;

url=&quot;$url_beginning$ip_address$url_end&quot;

echo $url

The code above will get the IP address (example: 10.0.0.5) of the device with the YOUR_MAC_ADDRESS MAC Address (example: 0:10:75:57:13:22). Then it will concatenate the correct URL (example: afp://10.0.0.5/YOUR_USER_NAME) and connect it as shown in the image below.