# Applescript for mounting AFP volumes OS 10.4.9



## sakohl (Oct 23, 2007)

I have written the following script, when I run it I get different results. Can someone tell me what I'm doing wrong? I am trying to automount AFP volumes without any user interface at startup. The script that is written will  be placed in the login items one it works!

Here is the script:

property volumesToMount : {"afp://Mac31192.168.1.19/Fonts", ¬
	"afp://Mac31192.168.1.19/Raid_0", ¬
	"afp://Mac31192.168.1.19/Raid_1", ¬
	"afp://Mac31192.168.1.19/Raid_2", ¬
	"afp://Mac31192.168.1.19/Raid_4"}

repeat with thisVolume in volumesToMount
	mountTry(thisVolume)
end repeat

on mountTry(thisVolume)
	try
		mount volume (thisVolume)
	end try
end mountTry

The results I get are the first volume mounting with a login screen, the 3rd and 5th volume mounting, and volumes 0-4 mounting. I have never gotten all five volumes to mount without any user intervention.

Thanks in advance for your help!

sakohl


----------



## Captain Code (Oct 24, 2007)

There's absolutely no need to do that if you want it to auto mount on login.  Just mount the shares you want and then drag them into Login Items.  When the user logs in they will automatically mount assuming you are on the network.

I assume this is what you want because you say you will put it in the login items.


----------



## sakohl (Oct 24, 2007)

The reason I am writing the script is that the operators do not like to have to option-click to close all the mounted volume windows. So I'm still looking for advice on how to fix this script or write a new one that will not require any user intervention.

Thanks


----------

