View Sidebar
Mount a library as a network drive

Mount a library as a network drive

November 29, 2013 16:54

The following AppleScript will allow you to mount a particular server library as a map drive on mac.

The script also adds the map drive to you login items, so that when you re-login the map drive is already available. It was used by me for mounting the SharePoint 2013 team site libraries.

 tell application "Finder"
    do shell script "mkdir -p $HOME/Desktop/"
    mount volume "SERVER ADDRESS" as user name "USERNAME" with password "PASSWORD";
    do shell script "ln -s /Volumes/LIBRARYNAME/ ~/Desktop/LIBRARYNAME"; 

    tell application "System Events"
       if (login item "LIBRARYNAME" exists) is false then make new login item at end of login items with properties {path:"/Volumes/LIBRARYNAME/", hidden:true, kind:application, name:"LIBRARYNAME"}
    end tell

end tell
If you like the article please share

Leave a reply

You must be logged in to post a comment.