Simple Login Script Issue

Discussion in 'Mac Programming' started by thriftinkid, Feb 3, 2009.

  1. macrumors regular

    Joined:
    Mar 24, 2008
    #1
    Hey Guys,

    I wrote a simple script that should open safari, take me to a website, and keystroke my name a password. It is case sensitive, so I wrote the following script. But I keep getting this error message:

    syntax error:

    Expected end of line but found identifier.


    Any Ideas why?


    For Reference:
    Login Name:
    login\MYname
    Password: 1234fake


    Code:
    set theURL to "http://www.mywebsite.com"
    
    tell application "Safari" to make new document with properties {URL:theURL}
    delay 5
    tell application "System Events"
    keystroke "login\"
    keystroke "my" using shift down
    keystroke "name"
    keystroke tab
    keystroke "1234fake"
    keystroke return
    end tell
     
  2. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    Maybe it needs to be "login\\"?

    Ironically Microsoft explains it here.
     
  3. thread starter macrumors regular

    Joined:
    Mar 24, 2008
    #3
    That did it. Thanks a bunch.
     

Share This Page