• 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: 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 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



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

  • Prev by Date: Re: Help with Script to mount SMB
  • Next by Date: Re: LiferayNativity.osax?
  • Previous by thread: Re: Help with Script to mount SMB
  • Next by thread: Re: Help with Script to mount SMB
  • Index(es):
    • Date
    • Thread