• 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: Unwanted dialog if mounting fails
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unwanted dialog if mounting fails


  • Subject: Re: Unwanted dialog if mounting fails
  • From: Jim Skibbie <email@hidden>
  • Date: Wed, 29 Jul 2009 15:23:14 -0500
  • Thread-topic: Unwanted dialog if mounting fails

Title: Re: Unwanted dialog if mounting fails
I think the issue is not determining when to mount the volume. The issue is when you want to mount the volume, but for whatever reason, the volume cannot be mounted (e.g., the remote volume you want to mount is on a server that is down). In the past, you would get an error while mounting that you could trap in a try block and then handle. With the introduction of the dialog box (is this new in Leopard?) you don’t get any error, but your script can timeout waiting for someone to answer the dialog box. If the script is on a headless Mac, what is the solution as there is no one looking at the screen and answering the dialog box?

My solution was to abandon the Scripting Addition’s
mount command and go with a Unix command to make a folder and then make that folder a mount point to the volume you wanted. Something like:

set vol to "Fake Volume"
set
Server_Path to "afp://fakeuser:fakepassword@fake.host.IP.address/"
set
mount_url to (Server_Path & vol) as string

try
   do shell script "mkdir -p /Volumes/" & quoted form of (vol as string)
   do shell script "mount -t afp " & quoted form of mount_url & " /Volumes/" & quoted form of (vol as string)
on
error errMsg number errNum
   display dialog errMsg & return & errNum
end try

Jim

Date: Wed, 29 Jul 2009 06:56:04 +1000
From: Peter Baxter <email@hidden>
Subject: Re: Unwanted dialog if mounting fails
To: Applescript Users <email@hidden>

HI,

You don't need to load the volume to know if it is mounted.  An alias  
of the disk will be kept in the folder /volumes/ while if it is  
loaded.  Simply check if the alias is present in this folder and you  
avoid the long wait in your script, and the problematical dialog.  You  
can then mount the volume only if it is missing.

Peter Baxter

On 28/07/2009, at 7:32 PM, Yvan KOENIG wrote:

>
>
> if exists volume xx then mount volume xx
>
> Yvan KOENIG (from FRANCE mardi 28 juillet 2009 11:32:35)
 _______________________________________________
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: Unwanted dialog if mounting fails
      • From: Bert Groeneveld <email@hidden>
  • Prev by Date: Re: Sending Mail
  • Next by Date: Re: In a handler passed as a parameter to a handler in another script, how do I refer to top-level variables from the original script?
  • Previous by thread: Re: Unwanted dialog if mounting fails
  • Next by thread: Re: Unwanted dialog if mounting fails
  • Index(es):
    • Date
    • Thread