Re: Help with Script to mount SMB
Re: Help with Script to mount SMB
- Subject: Re: Help with Script to mount SMB
- From: "Ball, Dan" <email@hidden>
- Date: Fri, 16 Oct 2015 19:22:48 +0000
- Thread-topic: Help with Script to mount SMB
Thanks all, I’ll mess around with these other scripts and see how they go!
set diskName to "share"
set itExists to false
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
set itExists to true
end if
end tell
if not itExists then
try
mount volume "smb://server.yourdomain.com/share"
end try
end if
set serverName to “smb://myserver/"
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
-Dan
_______________________________________________
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