Problems mounting afp shares

Hi!

My goal is to mount 6 shares from three difrent windows2000 servers.

First I tried to mount the shares using the following Applescript:

tell application "Finder"
	activate
	mount volume "afp://user:password@server/share/"
	
end tell

But all I get is error code -3170. (apparently Applescript has problems connecting to win2000 afp shares)

Then I decided to use aliases to mount the wanted shares. I made a folder called “Palvelimet” where I put the aliases.
Using the following Applescipt I get the job done, but its not pretty:

tell application "Finder"
	activate
	select file "KIL_DORIS_FS" of folder "Palvelimet" of startup disk
	open selection
	close container window of disk "KIL_DORIS_FS"
	select file "KIL_Doris_Mat" of folder "Palvelimet" of startup disk
	open selection
	close container window of disk "KIL_Doris_Mat"
	select file "KIL_Doris_Mat2" of folder "Palvelimet" of startup disk
	open selection
	close container window of disk "KIL_Doris_Mat2"
	select file "KIL_Doris_PDF" of folder "Palvelimet" of startup disk
	open selection
	close container window of disk "KIL_Doris_PDF"
	select file "pre_doris" of folder "Palvelimet" of startup disk
	open selection
	close container window of disk "pre_doris"
	select file "pre_mat" of folder "Palvelimet" of startup disk
	open selection
	close container window of disk "pre_mat"
end tell

Problems:

  • Share windows keep poping up and closing wich will confuse the users.
  • Finder asks for login and password three times during the script. (three different servers)

Is there a way to make Finder “invisible” during the script?
I tried “set the visible of process “Finder” to false” but it didn’t work.

Is there a way to make Applescript fill login and password information automatic?

As you all can tell I am a Applescript newbie and any help will be greatly appreciated.

Thanks
-kimmo
(Mac OS 9.1)

This can be complicated only because Apple broke it at one point. Depending on the version of the OS you are running this should work. Note that you don’t have to tell the “Finder” because the code is in the “Standard Additions” not the “Finder”.

mount volume "afp://Server/Share" as user name "theName" with password "myPass"

I am currently on a PC and don’t have my Mac close by so I’m not sure if I’ve got all the code exactly right or not. You can verify by opening the “Standard Additions” and looking for “Mount”

I hope this helps and good luck!
Dave

Thanks.

I got two of the three servers mounted using your syntax. Thats good enough. :lol:

-kimmo

Hey guys, I am in a similar situation, and I am also new to Applescript. Can you please explain to me what “Standard Additions” is?

I am trying to login to a Windows 2000 IIS Server automatically, right after my Mac starts up. This is my first script so I am a it lost…for now. I used the Schedule tab in Control Panels>Energy Saver to set my Mac to start up every week day morning at 9 a.m. When I get to work, my computer is started up, and the server login screen is sitting on my desktop waiting for me to enter my user name and password. Sometimes, the login box has disappeared if I get in too late. What I would like to do is have the Applescript automatically log me in as soon as the server login dialog box appears.

Here’s the setup:
I have named the Windows 2000 IIS Server “BGwin2K”

“BGwin2K” containes the following server volumes:

Clients
Individuals
vpdwork
wwwroot
BrookGroup

Will the following script work:
tell application “Finder”
activate
mount volume “afp://BGwin2K/Share” as user name “myName” with password “myPass”
end tell
Or will I need to use this:
tell application “Finder”
activate
mount volume “afp://BGwin2K/Share” as user name “myName” with password “myPass”
end tell

tell application “Finder”
activate
select file “Clients” of folder “BGwin2K” of startup disk
open selection
close container window of disk “Clients”
select file “Individuals” of folder “BGwin2K” of startup disk
open selection
close container window of disk “Individuals”
select file “vpdwork” of folder “BGwin2K” of startup disk
open selection
close container window of disk “vpdwork”
select file “wwwroot” of folder “BGwin2K” of startup disk
open selection
close container window of disk “wwwroot”
select file “BrookGroup” of folder “BGwin2K” of startup disk
open selection
close container window of disk “BrookGroup”
end tell

Or neither? I triend to peice the above script together using what you guys had discussed above.(?) Is there a certain script I need to include to make it work with the Sheduled start up each morning? Any help is appreciated…A LOT! I hope I have been clear enough, if not ask away. In the mean time I will try to test the scripts I came up with.

Thanks,

The “Standard Additions” are a default set of Scripting Additions which are intsalled on everyones system, Scripting Additions themselves, add functionality to AppleScript. There are many third party Scripting Additions that perform many different tasks. For more info about Scripting additions visit…

http://www.osaxen.com/index.php

Thanks, I am looking the site over right now. It would be nice, if somehow there could be a section in the forums with “Helpful Links” or something to that effect, with URLs and descriptions of what the listed URLs provide. It would probably be a ton of work and research, but maybe users of this forum could compile them and them submit them to MacScripter for approval? Just a thought?

I am still trying ot work out the server login script, UNSUCCESSFULLY so far, so if anyone can steer me in the right direction please do. I tried to let Applescript Record the logging in process, but it does not work when I try to Run the Recorded action. Why?

When selecting Record, while logging into the server here at work, this is what Applescript records:

tell application “Finder”
activate
select file “Chooser” of folder “Apple Menu Items” of folder “System Folder” of startup disk
open selection
end tell

I then trash the server volumes that have appeared on my desktop, and then try to run the Recorded script, but it does not work. All that happens is a dialog box appears, named “the result” which looks like a small text document. This is what “the results” says:

file “Chooser” of folder “Apple Menu Items” of folder “System Folder” of startup disk of application “Finder”

If I recorded the whole logging in process, why doesn’t it run what I recorded when I hit run?