Press Up or Down doesn't work

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Alistair
Newbie
Posts: 4
Joined: Sat May 29, 2004 12:13 am

Press Up or Down doesn't work

Post by Alistair » Mon Jul 24, 2006 6:07 am

If I create a macro with Press Up or Press Down, nothing happens.
If I create a macro by recording keystrokes the Pressing works.
If I play back the macro it doesn't work.

I am trying to use it on a Windows FoxPro appliaction. Using the Mouse Move functions works but I prefer to use the keys to eliminate screen size issues.

What am I doing wrong.

The operting system is Win XP

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Mon Jul 24, 2006 1:38 pm

Please post the bit of code that seems to not be working. In this case, it's difficult to know the problem without seeing the code....

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 » Mon Jul 24, 2006 1:40 pm

If you provide a sample of the script it will be much easier to help you.

Are you sure the window is ready to accept inputs?
Before you send the Up/Down are you using SetFocus?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Jul 24, 2006 2:00 pm

I have a vague recollection that FoxPro is 16 bit. Could be the reason? Which version of FoxPro you using?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Alistair
Newbie
Posts: 4
Joined: Sat May 29, 2004 12:13 am

Post by Alistair » Tue Jul 25, 2006 12:53 am

It's a simple script and will form part of a more complex one. Here tis

// C:\Documents and Settings\Administrator\My Documents\My Macros\test.scp
// Recorded on Tuesday, July 25, 2006, at 08:46 AM Oz time

//Recorded Events
SetFocus>NEXTRA*
Let>WW_TIMEOUT=5
CapsOff
Wait>0.77
Press Down * 12
Wait>0.7
Press Enter
Wait>0.06


The application comes into focus and the appliaction accepts the ENTER key however the Press Down function has no effect.

As you can see I captured this with the recorder. When I recorded the script the appliaction worked fine.

The Foxpro is 2.6a for Windows

Alistair :lol:

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Jul 25, 2006 2:18 am

FoxPro 2.6a is a 16 bit application. That could be the problem. We can only expect success against native 32 bit applications. FoxPro 2.6a is running under wowexec.

You could try this:

Code: Select all

Let>VK_UP=38
Let>VK_DOWN=40
Let>ExtendedKey=1
Let>KeyUp=2

LibFunc>user32.dll,keybd_event,r,VK_DOWN,0,ExtendedKey,0
Wait>0.5
LibFunc>user32.dll,keybd_event,r,VK_DOWN,0,FLAGS,0
Or try holding the key down - see:
http://www.mjtnet.com/forum/viewtopic.php?t=1991

If that doesn't work, nothing will.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

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