1 Reply Latest reply: Jun 22, 2011 11:41 AM by baltwo
ricardoSA Level 1 Level 1 (0 points)

I created a applescript to automatic fill the login information for a webpage. I made it four months ago and it works fine untill a month aprox. The problem is very wierd, It fills the first field, the username, using the command "keystroke" and it does but not in the right order.

 

My username is "rsolanilla" and it types "srolanilla" most of the times and other combinations much less often. It types ok some times too, but is quite random.

 

I use it into a automator application, but I tested from applescript and automator and the results are the same.

 

This is the part of code I talked about:

tell application "Safari"

    activate

    set thisDocument to make new document at end of documents

 

    do JavaScript "window.open('" & mainURL & "')" in thisDocument

 

    tell application "System Events"

        tell application process "Safari"

            delay 3

            -- keystroke (ASCII character 9) — tab character

 

 

           keystroke mainLogin

            --delay 1

            keystroke (ASCII character 9) -- tab character

            --delay 1

            keystroke mainPword

            keystroke (ASCII character 13) -- this equals return

 

        end tell

    end tell

 

end tell


iMac, Mac OS X (10.6.7)