Re: Help with Script to mount SMB
Re: Help with Script to mount SMB
- Subject: Re: Help with Script to mount SMB
- From: Jim Weisbin <email@hidden>
- Date: Fri, 16 Oct 2015 09:06:23 -0400
"Ball, Dan" <email@hidden> wrote"
Here is what I changed it too: set diskName to “share" tell application "Finder" if disk diskName exists then display dialog "I cannot locate your U: Drive or you already have it mounted!" buttons {"Cancel"} default button "Cancel" with icon caution giving up after 10 else tell application "Finder" try mount volume " smb://server.yourdomain.com/share" end try end tell end if end tell
Here is an alternate you could consider, which avoids any dialog unless there is an error:
set diskName to “myshare" set pathName to quoted form of "/Volumes/" & diskName set shareName to serverName & diskName tell application "Finder" mount volume shareName set theCommand to "cd " & pathName set theResult to do shell script theCommand if theResult is not equal to "" then beep display dialog theResult — optional to activate in Finder: else do shell script " open " & shareName end if end tell
Jim Weisbin | C.T.O. | human | |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden