• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Help with Script to mount SMB
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Help with Script to mount SMB
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: HSC to RGB
  • Next by Date: Re: Help with Script to mount SMB
  • Previous by thread: Re: Help with Script to mount SMB
  • Next by thread: Re: Help with Script to mount SMB
  • Index(es):
    • Date
    • Thread