Send Keys To Active Window

Discuss RoboTask here
Post Reply
LuceNut
Posts: 3
Joined: Wed Jun 22, 2005 9:55 am
Location: United Kingdom

Send Keys To Active Window

Post by LuceNut »

OK, I just started trying this an hour ago. I want to dial up an internet connection, wait 60 seconds to be sure we are connected, open a browser, tab 8 times, hit spacebar, wait 10 seconds for page to post, close browser, disconnect from dialup.
I work up until I try to tab 8 times. Anyone know how to do that? I'm trying the char value for tab "TAB". I just put it in the Keys: window like so
TAB
TAB
TAB
TAB
TAB
TAB
TAB
Space
But nothing seems to be happening when the browser window opens.
Help please?
Oleg
Site Admin
Posts: 3105
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Send Keys To Active Window

Post by Oleg »

You must write {TAB}{TAB}{TAB}{TAB} at send keystrokes settings. Try the sample task below. Save text of task to file and use Task | Import to import into RoboTask

;**********************
;* RoboTask Task file *
;* Do not edit!       *
;**********************

[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|2013454187
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task14"
Hide=INTEGER|0
ID=INTEGER|1935146196
Name=STRING|"Run ""IEXPLORE.EXE"""
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3

[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER

[Actions\Action1]
ActionID=STRING|"A_GENERAL_RUN_PROG"
Enabled=INTEGER|-1
Name=STRING|"Run ""//localhost/work/"""
Params=FOLDER

[Actions\Action1\Params]
program=STRING|"http://localhost/work/"
runas=STRING|"0"
wait=STRING|"0"

[Actions\Action2]
ActionID=STRING|"A_GENERAL_PAUSE"
Enabled=INTEGER|-1
Name=STRING|"Delay 2000 ms"
Params=FOLDER

[Actions\Action2\Params]
delay=STRING|"20"

[Actions\Action3]
ActionID=STRING|"A_GENERAL_SENDKEYS"
Enabled=INTEGER|-1
Name=STRING|"Send keys to active window"
Params=FOLDER

[Actions\Action3\Params]
currentwindow=STRING|"1"
fixedwindow=STRING|"1"
keylayout=STRING|"0"
keys=STRING|"""{TAB}{DELAY 1000}{TAB}{DELAY 1000}{TAB}{DELAY 1000}{TAB}{DELAY 1000}{Enter}"""
sendkind=STRING|"0"
wincaption=STRING|"Notepad"
LuceNut
Posts: 3
Joined: Wed Jun 22, 2005 9:55 am
Location: United Kingdom

Send Keys To Active Window

Post by LuceNut »

OK, that helped me. But I need to stick a down arrow in before the enter. How do I specify a down arrow in the keystrokes?
TIA,
Greg
Oleg
Site Admin
Posts: 3105
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Send Keys To Active Window

Post by Oleg »

There is button "Insert a key" for your help in settings form of "Send Keystrokes" action. You can use some complex combinations.
Arrows are {LEFT}, {RIGHT}, {UP}, and {DOWN}
LuceNut
Posts: 3
Joined: Wed Jun 22, 2005 9:55 am
Location: United Kingdom

Send Keys To Active Window

Post by LuceNut »

Yeah, that "Insert A Key" button doesn't put anything in the window for me! I'm navigating to a set of radio buttons on a webpage. The tabs get me there to focus on the first radio button but not selected. When I manually hit the down arrow it selects the second radio button and I hit enter to submit the form. But when the focus is on the first radio button in the Robotask and it executes {DOWN} it moves focus all the way to the submit button of the form. Any ideas why it works differently in Robotask as manually?
Thanks,
Greg
BTW, where are you from?
Oleg
Site Admin
Posts: 3105
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Send Keys To Active Window

Post by Oleg »

I don’t know. I’ve just tested on my computer - it works correctly.
May be, you need to put some pause between key pressing. For example - 0.3 sec.
Post Reply