Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'another way to applescript server shortcuts....' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
another way to applescript server shortcuts....
Authored by: eoberle on Feb 05, '05 06:47:53PM
Maybe someone will find this useful....Here's a little applescript I wrote that allows me to mount servers from a favorite list built into the script. It assumes that the passwords themselves are in the keychain, but I don't understand why you'd do it any other way. The nice thing about this is that once you fill in your servers in the server list, it will quickly mount as many volumes as you wish. Right now it default to mounting them all, but you can tweak that as you wish by changing the default items variable. If someone wanted to, it wouldn't be hard to have these lists built dynamically from the aliases in your 'favorites' folder. cheers, Eric


property server_list : {¬
	{name:"chris", address:"afp://xxx.local", volume:"chris"}, ¬
	{name:"itunes", address:"afp://xxx.local", volume:"itunes-g1"}, ¬
	{name:"itunes-backup", address:"afp://xxx.local", volume:"xxx"}, ¬
	{name:"fred", address:"afp://social-thought-server.local", volume:"fred"}, ¬
	{name:"backup", address:"afp://xxx.local", volume:"data-n-backup-d1"}, ¬
		}

set display_list to {}
repeat with the_item in server_list
	set display_list to display_list & name of the_item
end repeat


set choice to choose from list display_list default items display_list ¬
with prompt "Please select servers to mount" with multiple selections allowed

if choice is not {} then
	repeat with the_name in choice
		repeat with the_server in server_list
			
			if (name of the_server) is equal to the_name as string then
				try
					tell application "Finder"
						set x to mount volume (address of the_server & "/" & volume of the_server)
						log address of the_server
					end tell
				end try
			end if
		end repeat
		
	end repeat
end if




[ Reply to This | # ]