cannot unmount a drive. - syntax is fine - but the drive wont dismount

this is wierd…

i mount the drive using:

--  RaidPhotosStorage on Skunk
tell application "Finder"
		mount volume "afp://foo:bar@"
	on error -- oops, cant open
		display dialog ("Could not open the RaidPhotosStorage on the Skunkworks") buttons {"OK"}
	end try
end tell

and sometimes it does not show up in finder, yet you can browse out to it via terminal at:

the only way to get this out of my /volumes is to restart the appletalk server on my linux box…

any ideas???

The mount volume command has always worked unreliably for me too. I use the “open location” command instead. The only problem with open location is it opens a finder window in the process. Try this script which also closes the opened finder window.

set thisDisk to "RaidPhotosStorage"
set ipaddress to ""
set username to "foo"
set psswrd to "bar"

set success to my mount_network_drive(thisDisk, ipaddress, username, psswrd)
if not success then display alert "Error:" message "There was an error mounting the drive" as warning

on mount_network_drive(thisDisk, ipaddress, username, psswrd)
	if (list disks) does not contain thisDisk then -- check to see if the drive exists already
		open location ("afp://" & username & ":" & psswrd & "@" & ipaddress & "/" & thisDisk)
		set inTime to current date
			set outTime to current date
			if (list disks) contains thisDisk then
				delay 1
				tell application "Finder" to if Finder window 1 exists then close Finder window 1
				return true
			else if outTime - inTime > 10 then
				return false
			end if
		end repeat
	end if
	return true
end mount_network_drive

i will try this - thankyou

it works… Very odd, i am using the old syntax on my SMB shares (i never have a problem).


I’m glad it worked for you.

The mount volume command is “very odd”. I don’t know what its issue is but I’ve stopped using it totally because I can never be sure when it will/won’t work. My above script has never given me any problems.

it is tough because i am not sure if it is an issue on my client or on my server… i am running netatalk on my linux box (server) and that might be the issue…

very odd - indeed…