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 12:19:38 +0000
- Thread-topic: Help with Script to mount SMB
>Message: 8
>Date: Wed, 14 Oct 2015 08:09:53 -0400
>From: Jim Weisbin <email@hidden>
>To: email@hidden
>Subject: Re: Help with Script to mount SMB
>Message-ID: <email@hidden>
>Content-Type: text/plain; charset="utf-8"
>
>"Ball, Dan" <email@hidden> wrote:
>
>>Hoping someone can help with this script? I have a small xcode app I made years ago that gives users a GUI to mount shares off of our servers. I opened it up here just to make some small changes and I’m noticing the on error part not working anymore. I know this used to work, but not sure when it stopped.
>>Script:
>>tell application "Finder"
>>try
>>mount volume "smb://server.apple.com/share"
>>on error
>>tell application "Finder"
>>activate
>>display dialog "I cannot locate share or you already have it mounted!" buttons {"Cancel"} default button "Cancel" with icon caution giving up after 10
>>end tell
>>end try
>>end tell
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
_______________________________________________
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