Script to mount a server
In OS X you use the Go menu to Connect to a server. If you have installed the Script menu that comes with Applescript in your Applications folder you can place an applescript in there that will be a shortcut to mounting an often used server. Below is a script you can use:
tell application “Finder”
–activate
try
mount volume “afp://10.1.5.125/serverpartition” as user name “«your user id»” with password “«your password»”
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 tell
Replace the server ip address with your own. Replace the username and password to your network username and password. You can also mount samba mounts by changing the afp: to smb:
April 15th, 2005 at 6:28 am
First of all, thank you for posting the script.
Our administrator has the server set up so that we don’t require a username and password (don’t ask me why). Because of this, we have to use the long way to mount a server, clearing these two fields. I’m trying to create a script that will clear the fields automatically but, unfortunately, I’m not knowledgeable enough in Applescript or network administration to accomplish this. Do you have any suggestions? It is a samba server.