How should i approach a server-mounting script?

I’ve written an almost-complete AppleScript in the basic editor designed to prompt users for their password and then mount a specific server share. I’ve run into a problem that has made me consider rewriting this using Xcode; i need to prevent Finder from opening a window that interrupts my script (it opens the server-mounting username and password prompt when i don’t want it to).

So i need advice. First, can i assert that kind of control over Finder using Xcode or something? If not, i’m hoping that i would at least be able to detect that window as it opens and cancel it immediately. So what kind of Xcode project should i use to do this? Just an Applescript App, or do i need to go all the way to Cocoa? If it makes any difference, i would also like to be able to display a progress bar, though that isn’t entirely necessary. Also, i’m obviously new to Xcode, so ease-of-transfer from my current AppleScript to whatever i need to do these things might matter.

Thanks for everyone’s help.

Operating System: Mac OS X (10.5)

Hi,

I think, Xcode is not necessary.

If you want to be prompted for user name and password, ask for it with a display dialog box.
Then insert the data into the URL which mounts the server (e.g. afp://username:password@server.com/volume)

If not, insert user name and password directly

Thanks for the reply. That method is exactly what i’m trying, but the issue is that if a user enters an incorrect password and the drive fails to connect, that’s when the Finder window that asks for the username and password pops up. That’s what i would like to prevent, so that the rest of the work that my script does can continue.

search the board for mount_afp. there are some sample scripts to handle the authentication independent from the Finder