• 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: Mounting volumes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mounting volumes


  • Subject: Re: Mounting volumes
  • From: "Stockly, Ed" <email@hidden>
  • Date: Thu, 19 Feb 2015 18:29:17 +0000
  • Thread-topic: Mounting volumes

Thanks RJ and Jörgen.

Here's what I've got, but there is an issue. If the server or volume can't mount a system error dialog appears, that isn't trapable and doesn't clear after a couple minutes or with an apple event time out. (This is a bug, no?) It happens in Yosemite, don't know about other versions.

The script this will live is designed to run unattended and if the volume isn't available it mounts a different volume. If that's not available is logs the error and continues.

———————
property myUsername : ""

property myPassword : ""

property myServer : "SeverName"

property myVolume : "VolumeName"


TryToMountTheServer()

on TryToMountTheServer()

try

mount volume "smb://" & myServer & "/" & myVolume as user name myUsername with password myPassword

return

on error

set dialogReply to display dialog "Volume Didn't Mount, re-enter username?" & return & return & ¬

"Username:" default answer myUsername ¬

buttons {"Change Username", "Cancel", "No change"} ¬

default button 1 ¬

with title ¬

"Change Username" giving up after 60

if button returned of dialogReply is "Change Username" then

set myUsername to the text returned of dialogReply

end if

set dialogReply to display dialog "Volume Didn't Mount, re-enter password?" & return & return & ¬

"Password:" default answer myPassword ¬

hidden answer true ¬

buttons {"Change Password", "Cancel", "No change"} ¬

default button 1 ¬

with title ¬

"Change Username" giving up after 60

if button returned of dialogReply is "Change Password" then

set myPassword to the text returned of dialogReply

end if

end try

end TryToMountTheServer

  ---------------------------







_______________________________________________
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

 _______________________________________________
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

References: 
 >Mounting volumes (From: "Stockly, Ed" <email@hidden>)
 >Re: Mounting volumes (From: RJay Hansen <email@hidden>)

  • Prev by Date: Re: Mounting volumes
  • Next by Date: Encoding
  • Previous by thread: Re: Mounting volumes
  • Next by thread: Re: Mounting volumes
  • Index(es):
    • Date
    • Thread