Scripting volume log in :?:

I have slightly modifed a script found here to log on to a remote volume. I get the dialog box that comes up with the volume, my password is autofilled from keychain, but I must manually click the enter button to okay the password. Is it possible to automatically bypass it? Thanks.

 on login()
	tell application "Finder"
		activate
			mount volume "afp://192.168.0.1/Drive/"
		--	want to script ENTER here
	end tell
end login

Can’t you put the user name and password in the script so that you don’t have to worry about the dialog box?


on login() 
   tell application "Finder" 
      activate 
         mount volume "afp://username:password@192.168.0.1/Drive/" 
   end tell
end login