Mount Volume Error Handling Connection failed Question

Hi all,

I was wondering how I can ignore the Connection failed dialog in OSX 10.4 when trying to mount a volume that isn’t available. Currently the dialog pops up ‘Connection failed …’ and in order to continue you have to click the OK button. I’d like to dismiss or ignore this dialog all together.

The following script should mount a list of volumes on other computers in a SOHO network environment:


set Drive_List to {"user@localhost/drivename", "Drive2", "Drive3", "LaCie Disk"}
-- replace the Drive1, Drive2 placeholder with the network drive urls in the following fashion: username@ipaddress/drivename -> guest@10.1.0.4/workdrive

repeat with the_drive in (items of Drive_List)
	--
	tell application "System Events"
		try
			if (exists disk the_drive) then
				-- Volume present
				display dialog "Volume " & the_drive & " is already mounted. Moving on." with icon note buttons {"Go ahead"} giving up after 3
			else
				-- Volume not present
				display dialog "Mounting Volume \"" & the_drive & "\" - Please wait." with icon note buttons {"Mounting..."} giving up after 5
				try
					mount volume "afp://" & the_drive
				on error 
					display dialog "Mounting failed." with icon caution buttons {"Next"} giving up after 3
				end try
				return 5 -- idle time
			end if
		end try
	end tell
	
end repeat

Any ideas? Is there an error number on could use to circumvent the pop up dialog?

Thanks.