Passwords and the internet

I have a simple script that I wrote to get to a web page, but I need the script to put my password in and click log in. Is this possible and if so how do I write it.
Thanks in advance.

I use Safari in OX X 10.3.4 and have a number of sites for which I do this type of scripting. It requires the scripting addition “Extra Suites” which allows for typing text and simulating key strokes from a script.


property user_Name:  "username"
property pass_Word: "password"
tell application "Safari" to activate
tell application "Extra Suites"
	ES type string user_Name
	ES type key "tab"
	delay 1
	ES type string pass_Word
	ES type key "return"
end tell

I store these scripts in the Scripts Folder of Safari so they are available when I’m on the net.

PS: Be sure that the cursor is in the user name box before you run the script. Also if you do any scripting at all I think you’ll find “Extra Suites” valuable. You can get Extra Suites at"
http://www.kanzu.com/index.html

Much appreciated, Paul. Thanks for the quick response. I’ll give this a try later on tonight.

Hi, I saw this post and am trying to adapt it for a repetitive task I have. I have to call up a web page, enter an email address and press Return. But Extra Suites keeps typing to my Script Editor window instead of the Safari window.

– QUERY USER FOR THE EMAIL ADDRESS
set email_address to “test”
repeat
try
display dialog “Enter email address:” default answer email_address
set email_address to the text returned of the result
exit repeat
on error number error_number
if the error_number is -128 then error number -128
beep
end try
end repeat
display dialog "The email address is " & email_address

– OPEN SAFARI AND GO TO THE RIGHT PAGE
tell application “Safari”
try
set the KBase_URL to “http://docs.info.mark.com/article.html?artnum=3&kbhost=kbase.info.mark.com:80/
end try
end tell

– ENTER THE ADDRESS AND HIT RETURN
tell application “Extra Suites”
ES type key “tab”
ES type key “tab”
– Actually there are 39 of these tab lines cuz I’m such a newb :stuck_out_tongue:
delay 1
– ES type string email_address
– ES type key “return”
end tell

How to I tell ES to type to the Safari window?

Thanks,
TotalNewbie


-- ENTER THE ADDRESS AND HIT RETURN 
tell application "Safari" to activate
tell application "Extra Suites" 
ES type key "tab" 
ES type key "tab" 
-- Actually there are 39 of these tab lines cuz I'm such a newb :P 
delay 1 
-- ES type string email_address 
-- ES type key "return" 
end tell 


I thik this will solve your problem !

Yes, I originally had that line in the script but it puts Safari on my home page :frowning:

(oh, and how do you make those code examples be single-spaced?)

Extra Suites works great. Is there a way to do it without extra suites?

Thanks again.

While the application “System Events” will let a script keystroke Unicode text and this could be used to enter your username and password, I didn’t find a way to simulate the “tab” key required between the two entries in the script.

I’m not sure why adding that line would put Safari on your home page, but then I am very confused regarding the goal of your script!

If you can email me the “exact script” , a stated goal & your problem I’ll try it out for myself and see if I can solve your issure.

2nd - I just select the “code” button in the compose window, type the code and reselect the “code” button !

Well, I’ve been working on it, it now stays on the right page and for some reason Extra Suites has started typing to the Safari window. (so much fun to be so new!!)

Now my problem is the ‘@’ sign in the email address. This line will not work because of it:

ES type string email_address

The error is: Extra Suites got an error: “‘me@mark.com’” doesn’t understand the ES type string message.

Suggestions?

Thank you!!!
NewbButWorkingOnIt

Modify the early portion of the script as follows:


- QUERY USER FOR THE EMAIL ADDRESS 
set email_address to "test" 
repeat 
try 
display dialog "Enter email address:" default answer email_address 
set email_address to the text returned of the result 
set email_address to email_address as string
exit repeat 
on error number error_number 
if the error_number is -128 then error number -128 
beep 
end try 
end repeat 
display dialog "The email address is " & email_address 

:smiley: set email_address to email_address as string :smiley:

Thanks Paul! Putting

 set email_address to email_address as string

right before I output the string works.

Now I am trying to figure out how to make it so that I can just click on an icon on my desktop to run the script. Any tips?

Edit: Okay, after much net trolling and experimenting I finally found the Save As… Application. :slight_smile:

Thank you,
ALittleLessNewb