Keychain scripting
Keychain scripting
- Subject: Keychain scripting
- From: Jack Putnam <email@hidden>
- Date: Thu, 20 Jul 2006 13:27:22 -0500
Greetings.
I have been getting my feet wet with some shell and AppleScripting
the last few months, and find myself stuck. I know there is a more
effective way to accomplish the task, but I am stuck.
I am working on a script to automate (somewhat) the configuration of
a network appliance. the script opens a browser window, puts in an IP
address and login window is displayed:
Username:
Password:
Log in button
Check box for remember my password.
Currently, I use gui scripting to type in the username (admin), the
password (1234), and then a couple of tabs and a return keystroke to
complete the login. Here is that portion of the script:
property target_URL : "http://192.168.2.1."
open location target_URL
delay 6
tell application "System Events"
keystroke "admin "
delay 2
keystroke "1234"
tell application "Safari" to activate
delay 2
tell application "System Events"
keystroke return
delay 3
end tell
end tell
This works in most cases, but the delays are painful, especially for
users with fast computers. I discovered that by using the remember my
password check box, this portion of the script is sped up greatly. So
I have been attempting to script a new internet key using keychain
scripting so as to bypass having to input the login information.
Here's that script:
tell application "Keychain Scripting"
make new Internet key with properties {name:"192.168.2.1 (admin)",
account:"admin", password:"1234", server:"192.168.2.1",
protocol:HTTP, authentication:default, security domain:"", path:""}
end tell
This creates a new key and if I compare it to the key that Safari
makes if I tick the check box, there are a few differences:
Safari generated: Where: http://192.168.2.1, Comments: default. Allow
Access: Safari
My script: Where: //192.168.2.1, Comments: blank, Allow Access:
Keychain Scripting
But, even if I make the changes in the internet key my script
generates manually so the two keys appear identical, the Safari
generated one works, and the script generated key does not.
Is there some property I am missing that isn't displayed in the GUI
interface that needs to be set? Or a more efficient way of handling
the login in process? I would like to be able to put up a splash
screen, and lock the display on the splash screen with all the
scripting going on in the background..., or speed up the scripting
process.
Any help and input is welcome and greatly appreciated.
Jack
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden