Simulate shift-tab with Automator/AppleScript? OSX 10.9.1, Late 2013 MBPr

I am trying to make a Automator workflow to connect to another machine on my network. How can I do this with Automator? I have it all set up up to the point where I have to enter and admin's name and password, but I can't find a way to simulate keystrokes that actually works. I found a method that sounded legitimate here, but this did not work for shift-tab (as the field selected on launch is the password, and I need to edit the username and password).

I tried this AppleScript, which is what that post told me to do:

on run {input, parameters}

tell application "System Events"
    keystroke (tab) using {shift down}
end tell

return input
end run


The Automator workflow claims to have finished with no error, but the field selected on launch is still selected. How can I successfully select this field? Thanks!
I'm answering the original question in the title in case people are searching for it and navigate to this page.


You don't need to put shift down in curly braces, unless it's a comma separated list.
If the "tab" in parenthesis doesn't work, try the key code.
For each key press, try telling System events to do so without end tell.


Depending on your application, you need to specify which application you are telling to do the commands, and other parameters such as the window.

For example, in Safari, with the suggestions above:

tell application "Safari"
    tell front window
       tell application "System Events" to key code 48 using shift down
    end tell
end tell