I'm having an odd thing happen when I send this code:
SRT>Clear
SetFocus>CurWindow
Press>CTRL
Wait>.5
SendText>a
Wait>.5
Release>CTRL
Wait>.5
Press>BACKSPACE
Wait>.5
END>Clear
It does what it is supposed to do, clears the value out of the field by selecting everything ctl-a then pressing backspace. But it is sending something else too and making me nuts. I hear a "ding" from the UI like there's an erroneous character that isn't allowed in that field. I can replicate it by hitting enter in that field.
Debugging is really tough because it doesn't work at all in debug mode. I guess focus doesn't automatically switch back after each command.
So any suggestions?
Also, is there any difference between send and sendtext? The manual seemed to indicate they're the same, but I just want to doublecheck. Maybe just coincidence but it seems like they're different, I couldn't tell you how though.
send sendtext and press
Moderators: Dorian (MJT support), JRL
Re: send sendtext and press
I use this trick all the time. Add a message box before you start the area of code you want to check then use SetControlText> to put data in the message box. The reason to use SetControlText> is that it does not steal focus like popping up a new message will do. Also set the coordinates of the message so it will display on screen someplace out of the way.
As an idea for how to debug your issue I put in two second waits after each step. You will see the code line number display in the message box. This way you'll know which line of code causes the "ding".
Send> and SendText> call the same function.
As an idea for how to debug your issue I put in two second waits after each step. You will see the code line number display in the message box. This way you'll know which line of code causes the "ding".
Send> and SendText> call the same function.
Code: Select all
Let>Msg_Xpos=10
Let>Msg_Ypos=10
Let>msg_Width=400
Message>
GoSub>Clear
SRT>Clear
SetFocus>CurWindow
Press>CTRL
SetControlText>Macro Scheduler Message,TMemo,1,_line_num
Wait>2
SendText>a
SetControlText>Macro Scheduler Message,TMemo,1,_line_num
Wait>2
Release>CTRL
SetControlText>Macro Scheduler Message,TMemo,1,_line_num
Wait>2
Press>BACKSPACE
SetControlText>Macro Scheduler Message,TMemo,1,_line_num
Wait>2
END>Clear
Re: send sendtext and press
Sweet! Great tip, thanks!