Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Sesshi

macrumors G3
Original poster
Jun 3, 2006
8,113
1
One Nation Under Gordon
What's the best way of going about this? For example, iTunes needs to access a network shared drive but the Mac has not been explicitly connected to the drive in question. I need it to mount the drive automatically if it is accessible.
 
What's the best way of going about this? For example, iTunes needs to access a network shared drive but the Mac has not been explicitly connected to the drive in question. I need it to mount the drive automatically if it is accessible.

Make a script and just fire it up in Quicksilver whenever you please.
 
In which case I can just double-click on the shortcut. If the share exists, I need OS X to reconnect automatically - it's a fairly basic and important requirement.
 
In which case I can just double-click on the shortcut. If the share exists, I need OS X to reconnect automatically - it's a fairly basic and important requirement.
Have the script map the drive then open iTunes, then rather than click to open iTunes, click to run the script.
 
Can you get it to simply connect at login instead, or is the problem that it gets disconnected and needs to be maintained? :)

Yes. Let me give you a typical situation:

Windows - I have Drives Z, X, Y and S mapped to different shared folders on servers / NASs. Some of these may be accessible or not depending on where I am but if an app launches that needs access to those network drives they will automatically try and connect, then give me an error if it doesn't exist. If the share is accessible, it will of course connect.

The Mac loses connections to network drives that are not accessible, when it sleeps and any number of other seeming reasons, and they have to be re-connected manually. It cannot be an app-specific script-triggered action because that will be unworkable.
 
Looks like it. I was meaning to pick it up in any case as my Macs were incapable of talking to anything else but the NAS and each other, thanks. I'll buy it now.
 
Mmkay, Dave chokes on my NASs. The QNAP TS-101 and the Thecus N5200 both generate authentication errors. Connects to my W2003 box fine. Never simple, is it? Something about tss_check_cifs is not running.
 
I'd suggest using Applescript to write a small app. Change the script icon to the application icon, and drop it in the dock instead of the original application.

Code:
tell application Finder
    mount volume "smb://username:password@someserver/sharename"
end tell
tell application iTunes to activate

or something like that. I'll try when I get home. If you leave the username/password out, it will prompt you.
 
This was published in SysAdmin Mag a while back it'll automount the share on demand. I used it for my iTunes library when it used to be on a samba share. It kinda assumes you know what you're doing in the terminal tho:

1 - Make sure fstab is in sync with the current NetInfo settings by running:
nidump fstab . >> /etc/fstab

2 - Edit fstab to include a line similar to the following
server:/share /Network/Servers url url==smb://user:password@server/share,net 0 0

(that should say user : password above, i couldn't get it to turn the smilies off)
Replace 'server', 'share', 'user' and 'password' with the required settings

3 - Load new fstab into NetInfo
niload fstab . < /etc/fstab

4 - Reboot and find the volume available under /Network/Servers/server/share

5 - Repoint iTunes if necessary and you're done.
 
@king - as I said earlier, it is not just for one app so redocking each app is not workable.

@tyr2 - I get it. It might work for me although it's a faff. I'll give it a try.
 
@king - as I said earlier, it is not just for one app so redocking each app is not workable.

Seriously? It takes about a minute to write and save the Applescript, so even if you had 10 apps its very workable...I am guessing its your iLife apps, so I don't see the issue...

tyr2, do you know the behaviour if the Volume is not available?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.