In trying to figure out a way to have network volumes auto-mount at startup without ending up with a desktop full of finder windows I came across an Applescipt. I made some changes (addition of a few delays and '2nd attempts' as it did not work consistently,) and all seems to work ok.
Now the problem is, when I connect to the machine over the network (afp) neither the root volume nor any of the network shares show up. Firewire drives still show up fine, however. I have determined it to be somehow releated to the script but I can't see how... Any ideas? Can anyone suggest a better way to auto-mount at startup (short of using NetInfo on OSX server)?
Here's the code:
Now the problem is, when I connect to the machine over the network (afp) neither the root volume nor any of the network shares show up. Firewire drives still show up fine, however. I have determined it to be somehow releated to the script but I can't see how... Any ideas? Can anyone suggest a better way to auto-mount at startup (short of using NetInfo on OSX server)?
Here's the code:
Code:
tell application "Finder"
delay 0.3
try
mount volume "afp://sumdumuser:sameolpw@MAC-SERVER.local/FTP"
on error
delay 1
try
mount volume "afp://sumdumuser:sameolpw@MAC-SERVER.local/FTP"
on error
display dialog "There was an error mounting the Volume." & return & return & ¬
"The server may be unavailable at this time." & return & return & ¬
"Please inform the Network Administrator if the problem continues." buttons {"Okay"} default button 1
end try
end try
delay 0.3
try
mount volume "afp://sumdumuser:sameolpw@MAC-SERVER.local/AnotherVolume"
on error
delay 1
try
mount volume "afp://sumdumuser:sameolpw@MAC-SERVER.local/AnotherVolume"
display dialog "There was an error mounting the Volume." & return & return & ¬
"The server may be unavailable at this time." & return & return & ¬
"Please inform the Network Administrator if the problem continues." buttons {"Okay"} default button 1
end try
end try
end tell