SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Send Keys Questions

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Send Keys Questions
Author Message
Gene Phares



Joined: 11 Apr 2001
Posts: 4

Post Send Keys Questions Reply with quote

I have a script that uses the "Run c:\....." statement with "sendkey" statements to emulate a user's key stroke sequence to a job. Everything was working fine until one time I activated another window while the job was running. The script continued the keystroke sequence in the new window, not the window the job originally spawned. I'm looking at putting a "WindowActivate" statement prior to each send keystroke. Is there a better way to handle cases like this. Will the Send Keystrokes work in background mode?

Thanks
Gene Phares

Wed Apr 11, 2001 3:16 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7948

Post Re: Send Keys Questions Reply with quote

RunWithInput starts programs make sure it gets activated and it waits as long as needed for the program to become "input ready" then it sends the specified keystroke.

If you want to use regular SendKeys, you should call WindowActivate just before that to avoid the problem described below.

SendKeys will work in the background mode (e.g. in asynchronous jobs)

: I have a script that uses the "Run c:\....." statement with
: "sendkey" statements to emulate a user's key stroke sequence to
: a job. Everything was working fine until one time I activated another
: window while the job was running. The script continued the keystroke
: sequence in the new window, not the window the job originally spawned. I'm
: looking at putting a "WindowActivate" statement prior to each
: send keystroke. Is there a better way to handle cases like this. Will the
: Send Keystrokes work in background mode?

: Thanks
: Gene Phares

Wed Apr 11, 2001 3:22 pm View user's profile Send private message
Gene Phares



Joined: 11 Apr 2001
Posts: 4

Post Re: Send Keys Questions Reply with quote

I changed the script to use the "RunWithInput". The script is provided below. What happens is that the script recognizes the application, userid and password and brings up the correct main form (tccom0401m000). However, it does not do anything after that. It just sits there until the application timeout has kicked in. These are the same settings I used in the other "run" statement, however, to get them working, I had to insert wait(5) statements between each keystroke. FYI, the data value "2664" is the first data input on the main form. What do I do to get the system to recognuize the "2664"?

Thanks,
Gene Phares

dim return_code, number
runwithinput ( "C:\Program Files\BAAN\BIN\BW.EXE tccom0401m000", "C:\Program Files\baan\bin", 30, "userid{tab}password{enter}2664{tab}2664{tab}{tab}{tab}{tab}{enter}{enter}is{shift}-cr2pc{enter}{enter}{alt}fx", 100, return_code )

: RunWithInput starts programs make sure it gets activated and it waits as long
: as needed for the program to become "input ready" then it sends
: the specified keystroke.

: If you want to use regular SendKeys, you should call WindowActivate just
: before that to avoid the problem described below.

: SendKeys will work in the background mode (e.g. in asynchronous jobs)

Wed Apr 11, 2001 6:15 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7948

Post Re: Send Keys Questions Reply with quote

You can use {wait 5} inside the keystoke. But then you may face the same problem again when the active window is changed while sending keystrokes.
The solution to this is to use combination of
Run, WindowWaitOpen, SendKeys, Wait, WindowFind, WindowActivate, and SendKeys again

: I changed the script to use the "RunWithInput". The script is
: provided below. What happens is that the script recognizes the
: application, userid and password and brings up the correct main form
: (tccom0401m000). However, it does not do anything after that. It just sits
: there until the application timeout has kicked in. These are the same
: settings I used in the other "run" statement, however, to get
: them working, I had to insert wait(5) statements between each keystroke.
: FYI, the data value "2664" is the first data input on the main
: form. What do I do to get the system to recognuize the "2664"?

: Thanks,
: Gene Phares

: dim return_code, number
: runwithinput ( "C:\Program Files\BAAN\BIN\BW.EXE tccom0401m000",
: "C:\Program Files\baan\bin", 30,
: "userid{tab}password{enter}2664{tab}2664{tab}{tab}{tab}{tab}{enter}{enter}is{shift}-cr2pc{enter}{enter}{alt}fx",
: 100, return_code )

Wed Apr 11, 2001 9:32 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.