macro seems to stop

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
CatBreath
Junior Coder
Posts: 32
Joined: Fri Jul 08, 2005 6:12 pm

macro seems to stop

Post by CatBreath » Thu Jul 28, 2005 1:41 pm

I use a script that opens icq2002, pushes a button and sends several key strokes.
The problem is that after the button is pressed no keystrokes are sent and the whole script seems to stop working.
When i focus on another window the script appearently starts working again...
Can anyone explain this?
Here's what my script looks like:

Input>icqloc,Where is the ICQ startup file? (icq.exe),D:\ICQ\Icq.exe
Run Program>icqloc
GetActiveWindow>icqTitle,Xwhereisstarts,Ywhereitstarts
PushButton>icqTitle,My
Wait>3
Press Up
Press Up
Press Down
Press Down
Press Down
Press Down
Press Down
Press Down
Press Down
Press Down

The button is pressed but no key strokes are sent unless i change focus and if i press down/up manualy than everything is fine.

Thanks!

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Thu Jul 28, 2005 2:08 pm

1. There is nothing to allow for the time it takes for the icq.exe application to start after the Run Program line. Subsequent commands may happen before the application is ready. Add a WaitWindowOpen line after the Run Program line.

2. You don't have a SetFocus line before the keystrokes are sent. How is the macro supposed to know where to send the keystrokes? At present they will land on whatever happens to have the focus at the time.
MJT Net Support
[email protected]

CatBreath
Junior Coder
Posts: 32
Joined: Fri Jul 08, 2005 6:12 pm

Post by CatBreath » Thu Jul 28, 2005 7:48 pm

the script is not complete and currently only works well when icq is active.

executing icq.exe brings icq to the foreground
and it is focused.
proof is that the button is pressed and that if i push the keys manually than it works.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Jul 29, 2005 1:11 am

Try doing something like this:

Code: Select all

Input>icqloc,Where is the ICQ startup file? (icq.exe),D:\ICQ\Icq.exe
Run Program>icqloc
WaitWindowOpen>icqTitle
WaitReady>1
SetFocus>icqTitle
PushButton>icqTitle,My
Wait>3
Press Up
Press Up
Press Down
Press Down
Press Down
Press Down
Press Down
Press Down
Press Down
Press Down 
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

CatBreath
Junior Coder
Posts: 32
Joined: Fri Jul 08, 2005 6:12 pm

Post by CatBreath » Fri Jul 29, 2005 11:38 am

Setting focus to it wont help since its already focused.

I tried and failed.

and i run the script when icq is already working so that it doesnt start the program but brings it to the foreground.

and when i use the script the little MS icon gets stuck on whichever color it was in (gray/yellow) and doesnt change untill i do something.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Jul 29, 2005 10:13 pm

Suggest that you send us a log file showing how it hangs up......
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

CatBreath
Junior Coder
Posts: 32
Joined: Fri Jul 08, 2005 6:12 pm

Post by CatBreath » Sat Jul 30, 2005 10:25 am

well i decided to give up, i'll just use MouseOver and LClick.
That seems to solve everything...

Thanks for all the replys!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts