Macro not recognizing keystrokes
Moderators: Dorian (MJT support), JRL
Macro not recognizing keystrokes
We are writing a macro for a Remote Desktop Session Apllication and it is not reading certain keystrokes. The Macro is not recognizing the following functions: Press ALT, Press CTRL, and Press TAB. When we type the script and run a preview the macro just skips over these functions. I have even tried recording the keys and that does not work either. Is there something I am missing?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Are you using SetFocus to make sure the correct window has the focus before the key sequences are sent? Perhaps it would help to see your script.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Yes we are using the correct SetFocus.
Here is the script we are using:
Change Directory>C:\Program Files\Prophet 21\CommerceCenter 10.5
Run Program>C:\Program Files\Prophet 21\CommerceCenter 10.5\pxxi.exe
Press Enter
Wait>5
***************
**LOCATION 101
***************
Press Alt
Send Character/Text>oo
Release Alt
Press Alt
Send Character/Text>rf
Release Alt
Send Character/Text>101
Press Enter
Press Tab
Press Tab
Press Tab
Press Tab
Press Tab
Press Tab
Press Tab
Press Tab
GetDate>the_date
Sub>the_date,3
MidStr>the_date,1,2,the_month
MidStr>the_date,4,2,the_day
MidStr>the_date,7,2,the_year
Send Character/Text>the_month
Send Character/Text>the_day
Send Character/Text>the_year
Press Alt
Send Character/Text>fp
Release Alt
Wait>2
Press Alt
Send Character/Text>n
Release Alt
Send Character/Text>\\network2\mc-manager
Press Tab
Press Tab
Press Enter
Press Alt
Send Character/Text>fn
Release Alt
Wait>30
**Exit Order Processing
Press ALT
Send Character/Text>fx
Release ALT
Here is the script we are using:
Change Directory>C:\Program Files\Prophet 21\CommerceCenter 10.5
Run Program>C:\Program Files\Prophet 21\CommerceCenter 10.5\pxxi.exe
Press Enter
Wait>5
***************
**LOCATION 101
***************
Press Alt
Send Character/Text>oo
Release Alt
Press Alt
Send Character/Text>rf
Release Alt
Send Character/Text>101
Press Enter
Press Tab
Press Tab
Press Tab
Press Tab
Press Tab
Press Tab
Press Tab
Press Tab
GetDate>the_date
Sub>the_date,3
MidStr>the_date,1,2,the_month
MidStr>the_date,4,2,the_day
MidStr>the_date,7,2,the_year
Send Character/Text>the_month
Send Character/Text>the_day
Send Character/Text>the_year
Press Alt
Send Character/Text>fp
Release Alt
Wait>2
Press Alt
Send Character/Text>n
Release Alt
Send Character/Text>\\network2\mc-manager
Press Tab
Press Tab
Press Enter
Press Alt
Send Character/Text>fn
Release Alt
Wait>30
**Exit Order Processing
Press ALT
Send Character/Text>fx
Release ALT
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Err, but you're not. There is not one SetFocus command in your script above. There is nothing to ensure the keystrokes land in the right place. Furthermore there is nothing to ensure the target window is active before the keys are sent. Your posted script is inherently unreliable and potentially dangerous.adunaway wrote:Yes we are using the correct SetFocus.
Please read "Scripting Windows for Beginners" in the help file. It demonstrates use of SetFocus, WaitWindowOpen and other important concepts to ensure the creation of a reliable script.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?