Re: Auto Login to server using OS 9.1
Re: Auto Login to server using OS 9.1
- Subject: Re: Auto Login to server using OS 9.1
- From: "email@hidden" <email@hidden>
- Date: Thu, 03 May 2001 16:55:33 -0500
on 5/3/2001 3:06 PM, Paul Fisher at email@hidden wrote:
>
I am trying to automatically log into a server during startup, but with
>
keychain access in OS 9.1 this is nearly impossible without using guest access
>
to my server, something i don't want to do. Apple says this is possible to
>
get around using an applescript that fills in the username and password and
>
presses "OK". Does anyone have suggestions on how i would do this?
>
>
i was thinking of putting an alias to the server in my startup folder and then
>
have a script run to fill in the password and then click "ok." or should the
>
script itself find the server?
>
>
thanks for the help
Save this as a stand-alone applet, place it in your Startup Items folder,
and run it. (Watch for line wraps ;)
-- begin script
property theKeyChain : ""
property thePW : ""
if theKeyChain is "" then
set theKeyChain to text returned of ,
(display dialog "Enter the name of the keychain to unlock:" default
answer "")
end if
if thePW is "" then
set thePW to text returned of ,
(display dialog "Enter the password for " & theKeyChain & ":"
default answer "")
end if
-- unlock the keychain
tell application "Keychain Scripting"
try
unlock keychain theKeyChain with password thePW
on error errmsg
notify with alert "Unable to unlock keychain \"" & theKeyChain &
"\": " & errmsg
end try
quit
end tell
-- wait until Keychain Scripting quits before doing options
tell application "Finder"
repeat until name of every process does not contain "Keychain Scripting"
end repeat
end tell
-- end script