Connect to a share from Applescript

More fun with mac scripting. There's a way to connect to a share on the network (mount/connect to a server if you're hopelessly lost in Mac-only parlance) using AppleScript:

tell application "Finder"
mount volume "smb://myserver.mydomain.net/myshare"
end tell

In my test, this code completed successfully, so it communicates with the Key Chain properly and finds the correct user and everything. It's rather impressive that you can coax so much functionality out of so few lines of code. What can I say? I'm becoming a fan of AppleScript.

Leave a Reply

Your email address will not be published.