mounting a volume

Hello,
i have a problem with mounting a volume that isn’t available yet…
Trying to use the “ingnoring application responses” but still getting a error and the script won’t move one.

is it possible at all?

any help would be appreciated


ignoring application responses
	mountVolume("username", "pswd", "serverIP", "volumename")
end ignoring
-- do the rest of the script

on mountVolume(username, pswd, serverIP, volumename)
	set serverstring to "afp://" & username & ":" & pswd & "@" & serverIP & "/" & volumename as string
	mount volume serverstring
end mountVolume

Hi,

application responses is useless, because there are no applications involved.
The easiest way is to catch the error


if mountVolume("username", "pswd", "serverIP", "volumename") then
	-- do the rest of the script
else
	-- do error handling
end if

on mountVolume(username, pswd, serverIP, volumename)
	try
		set serverstring to "afp://" & username & ":" & pswd & "@" & serverIP & "/" & volumename
		mount volume serverstring
		return true
	on error
		return false
	end try
end mountVolume

Hi Stefan,
Thank you for your help.
The script is stopped bij (I think the Finder) with a system message that the volume is unreachable.
So you need a user intervention to move on with the rest of the script.
What i want is that the script move’s on what ever the result is.

i hope that it’s possible

thanx

Rob

then use the mount_afp version


on mountVolume(username, pswd, serverIP, volumename)
	set theAddress to quoted form of ("afp://" & username & ":" & pswd & "@" & serverIP & "/" & volumename)
	set mountpoint to quoted form of ("/Volumes/" & volumename)
	try
		do shell script "/bin/mkdir " & mountpoint & "; /sbin/mount_afp " & theAddress & space & mountpoint
		return true
	on error
		do shell script "/bin/rm -r " & mountpoint
		return false
	end try
end mountVolume

Hi Stefan,
that does the trick.
Thank you very much.

Regards,

Rob