# AppleScript automount at startup



## cabbage (Aug 29, 2002)

I found an applescript that will mount network volume on startup.  It looks like this

tell application "Finder"
	try
		open location "afp://mjohnson:red4566@133.217.21.211/alljobs"
--the second volume here
--third volume here
--next volumes
	end try
end tell


When I run the script even when the volume is already mounted I get an error
server returned error -5062

Lets say I mount 8 network volumes on startup and after an hour of work I umounted 5 of them and still have 3 mounted.  I want to be able to run this script to remount the other 5, but as soon as it hits one of the 3 currently mounted volumes it gets an error.  That's not a big deal I click OK and it goes away but the problem is it does not continue with the rest of the script.

Is there an error handler or something were it can just ignore the error and still continue with the rest of the script.

Or is there a line I can add to the top that unmounts all network drives?

Any help is appreciated!


----------



## Trip (Sep 3, 2002)

I really have no clue, but I'll give it a shot:

I think there is a command (something like: "Disconnect all") you can use. OR you can make it so that it checks if the servers are mounted already and if they're not they will mount. Get it? That'd probably be easiest to do.


----------



## cabbage (Sep 3, 2002)

thanks i'll give that a shot


----------

