I looked through many of the topics dealing with automating the “Connect To Server” dialog, but I still can’t figure out how to automate my specific task.
I use the only Apple computer on a network of about 50 Windows machines. Using “Connect To Server” does not bother me, but it bothers the other users of the Apple, because the names of the Windows machines are the service tags of those machines (making it very hard to remember which computer is which).
All of the computers have a fixed IP address. All of the computers also have a generic user set up (both the username and password are “plant”). What is the script to connect to the computer at IP address 199.5.82.67, signing on as the plant user, and sharing the “C” drive of that computer?
I did the same search before posting this message, but I couldn’t actually plug my data into any of the samples given. I was hoping that somebody may be able to show me the “mount volume” (I think) statement for mounting the C drive of the computer located at 199.5.82.67 (signing on to the machine as plant (username & password = “plant”)).
Use this script and save it as a application. then copy the application to the login items section of System Preferences.
on run
tell application “Finder”
try
– you must insert your own server information as outlined in the mount volume module
mount volume “afp:///” as user name “” with password “”
on error
display dialog “There was an error mounting the Volume.” & return & return & ¬
“The server may be unavailable at this time.” & return & return & ¬
“Please inform the Network Administrator if the problem continues.” buttons {“Okay”} default button 1
end try
end tell
end run
I realize this is an Applescript Forum, but what’s wrong with mounting the volume once, adding the user id and password to the keychain, and then making an alias of the volume on the desktop?
Just double-clicking on the alias will mount the volume (Mac or PC) with no user intervention…
You can also add the alias as a login item and it will mount at startup/login
That works just fine. I actually wrote a startup script that opens alias’ of a handful of servers on my company network. I actually prefer that because you have to put a password in your script. If you ever distribute your script, you may unwittingly distribute your username and password. In some settings, no big deal. Some of use are also responsible for security measures… Lead by example I guess… Just figure out which way works best for you and keep the security issue in mind.
open file "AOCDTP Server" of folder "Macintosh HD:Users:sprale:Documents:Locations"
Model: Dual 2.3GHz G5
AppleScript: 2.1.1/SD4
Browser: Firefox 2.0.0.4
Operating System: Mac OS X (10.4)
Nevermind, it works if you save the password in your keychain. I am not sure what happens when the password expires yet, though.
on run
tell application "Finder"
try
-- you must insert your own server information as outlined in the mount volume module
mount volume "smb://icepsilon/share" as user name "sprale"
on error
display dialog "There was an error mounting the Volume." & return & return & "The server may be unavailable at this time." & return & return & "Please inform the Network Administrator if the problem continues." buttons {"Okay"} default button 1
end try
end tell
end run