Mac one-click drive mappings

This is likely in various formats all over the web, but I use this often enough I’m putting it here for my own use.  Feel free to use it and let me know how it works.

How to make one-click drive mappings on the mac

1) I started by modifying an Applescript file that a buddy sent me. Mine looks something like this.  You’ll have to fill in the italicized stuff:

tell application "Finder"
mount volume "smb://servername.domain.blah/volumename/username"
end tell
(*
tell application "Finder" to open "username"
*)
tell application "Finder"
mount volume "smb://servername.domain.blah/volumename/directoryname"
end tell

(*
tell application "Finder" to open "directoryname"
*)

2) I copied the text of the script into my clipboard.

3) I then opened up Automator, selected Custom Workflow, and navigated to Utilities–>Run Applescript

4) I pasted the contents of my Applescript into that window, then hit the Compile button.

5) I chose Save As, and in the File Format dropdown I selected Application.

6) From there, I just saved the app file somewhere safe (made a folder off the root drive, rather than keeping the script right on my desktop) and then dragged it to my Dock. The first time I mapped the drive I saved my username and password to the keychain, and I’m all setup with one-click drive mappings.

This entry was posted in Tech Stuff. Bookmark the permalink.