Sunday, August 19, 2007

Mount SMB Shares in OSX via an Application

If your like me I hate the command-K option because it leaves your usernames and passwords unsecured in the finder. Here is a way to use an application to mount smb shares. Just paste the applescript into the Script Editor, change the credentials, check the "run only"(to make it secure) and save as type = Application.

tell application "Finder"
open location "smb://usernamme:pass@ServerName1/share1"

open location "smb://usernamme:pass@ServerName2/share2"

end tell

For an application to unmount these paste the following in...or just drag them to the trash.

tell application "Finder"
try
if "Share1" exists then
eject "Share1"

end if
if "Share2" exists then
eject "Share2"

end if
end try

end tell

Enjoy...

No comments: