automatic AFP mount using Login Items

Joined
Apr 17, 2008
Messages
27
Reaction score
1
Points
3
Hi,

This seems like an obvious question, but after searching, I still haven't found the answer.

It's like this: I've added a network volume at home so it's mounted automatically when I login (an AFP share on my NAS). This works fine, but the problem is that when I use my laptop at work, where my NAS is not available, I get this message saying that the NAS is not available. But osx keeps trying multiple times, and I receive the message a couple of times and it also slows down the general responsiveness of the os.

So I thought: maybe I should start working with Locations? So I made a location "home" and a location "Work". This way I can also change the network adapter from WIFI to Ethernet which is convenient.

However, I have no idea how to link the Login Items in the User preferences to the chosen Location? How do you make these work together? I must be missing something, right?

Thanks,
Kris
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,765
Reaction score
2,106
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
From what I know, the login items can't be linked to particular location, they are really not related. It is interesting that it tries to repeatedly mount the share, I've got a similar situation where I mount a couple of shares from my NAS on the Mac through Login Items and if the NAS is unavailable for any reason, I just get a message one time that it couldn't mount it and it's done..

What version of OS X are you using?
 

Slydude

Well-known member
Staff member
Moderator
Joined
Nov 15, 2009
Messages
17,612
Reaction score
1,079
Points
113
Location
North Louisiana, USA
Your Mac's Specs
M1 MacMini 16 GB - Ventura, iPhone 14 Pro Max, 2015 iMac 16 GB Monterey
Here's a thought that I have not tested not being a scripting genius but from what I have read is possible.

1.Create to locations in the Networking preference pane. One mounts the share one does not.
2. Use an Applescript to choose the appropriate location. See an example of how here. The example is for 10.6 but it should work.
3. If "home" is chosen then the script could probably be modified to mount the share.

I was already thinking of something similar to mount my iTunes library. I would like to mount the share but have it not appear on the desktop. Found the shell command to do it but have not worked out the exact syntax.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top