Re: Fwd: mount volume
Re: Fwd: mount volume
- Subject: Re: Fwd: mount volume
- From: Axel Luttgens <email@hidden>
- Date: Mon, 24 Sep 2007 10:22:30 +0200
On 24/09/07 8:18, Wayne Melrose wrote:
Just re-posting my question, I didnt get any response first time
round :)
Begin forwarded message:
[...]
I've got a script that runs and mounts volumes on request... This is
a server and so it would be best that errors happen silently, log,
and move on..
On occasion servers that it connects to will not be available, in
which case I'd like it just to log that it didnt perform the task
and move one.
However I've just discovered something very odd..
here is a small handler i've made for mounting disks.
--------------------- script start
on MountVolume(SMB_afp, diskname, usr, pass, ipadd)
try
mount volume SMB_afp & "://" & usr & ":" & pass & "@" &
ipadd & "/" & diskname & "/"
return "Disk Mounted"
on error errmsg
return "Disk unavailable"
end try
end MountVolume
--------------------- script end
However, if the disk is unavailable it will error, but also display
a dialog error..
I tried wrapping this in "ignoring application responses" although
that didnt seem to solve it.. ?
This one tells AppleScript not to wait for the results of commands sent
to an application, so that the script's execution continues without delay.
Clearly, this is not your concern here.
Surely there is a way to make this silent?
I fear one can't avoid that built-in behavior of the "mount volume"
command; after all, it is devised to provide the user with any needed
feedback...
So, the only way I can think of is to go with "do shell script", applied
to the "mount_afp" and "mount_smbfs" command-line tools.
That way, with the help of "try ... on error ...", it should be possible
to achieve a perfectly silent behavior in case of failure.
HTH,
Axel
_______________________________________________
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