patgenn123 Posted July 28, 2010 Report Share Posted July 28, 2010 Hello everyone! I am having a somewhat difficult time trying to figure out a simple thing. I want to Get a control and force a change in the field without having it gain focus. I am using Variable Modify Control to try to force the switch, but it's not working. It works well when you have to GET CONTROL/GET CONTROL TEXT/FOCUS CONTROL/BACKSPACE/TEXT TYPE TO CONTROL(Send Text Directly to Control). What I really want to do is to force the change using Variable Modify Control without having the text "highlight" in blue that it's focused on. In other words, is there anyway of making this seemless without the evidence that a macro is doing the work behind the scenes? Am I thinking this through correctly? Pat Quote Link to comment Share on other sites More sharing options...
kevin Posted July 28, 2010 Report Share Posted July 28, 2010 Just to be clear, the Variable Modify Control command changes the control variable, not the Window Control within the other application. If the application accepts text via Window Controls you can send text to the control use the 'Send Text Directly to Control' option in the Text Type command. With most (all?) applications sending text to a control this way does not set focus to that control. The only way to tell how it is going to work is to try it. Quote Link to comment Share on other sites More sharing options...
patgenn123 Posted July 28, 2010 Author Report Share Posted July 28, 2010 Kevin, I tried to do this, but for some reason, it doesn't superimpose the new text on top of the old rather it places it right before the old text and leaves the old text to the right of the new text. I'll keep experimenting, but if anyone has a solution to this, I wouldn't mind knowing about it. Thanks, Pat Quote Link to comment Share on other sites More sharing options...
acantor Posted July 28, 2010 Report Share Posted July 28, 2010 Kevin, I tried to do this, but for some reason, it doesn't superimpose the new text on top of the old rather it places it right before the old text and leaves the old text to the right of the new text. I'll keep experimenting, but if anyone has a solution to this, I wouldn't mind knowing about it. Try sending <CONTROL>a or <SHIFT><END> before sending the keystrokes to the control. Either of these key sequences should select the text. Then, when you send new text to the control, it will replace the existing text. You may or may not need a short delay between the two steps. Quote Link to comment Share on other sites More sharing options...
patgenn123 Posted July 28, 2010 Author Report Share Posted July 28, 2010 Alan, I used Shift Down/Control Down/Arrow Left, but unfortunately it defeats the purpose. I am trying to superimpose the new text ontop of the old text without the focus color blue showing on the field. I cannot understand why I cannot get this to work. Pat Quote Link to comment Share on other sites More sharing options...
rberq Posted July 29, 2010 Report Share Posted July 29, 2010 With "Text Type - Send Directly to Control", it sounds like it is sending the text just as if you first positioned the cursor at the beginning of the field, then did a standard Text Type command. Try appending a bunch of <DELETE> characters to the end of the text before you send it to the control, and see what happens. With luck it will insert your text ahead of what is already there, then delete the original text. Edit: I tested with the Windows Calculator. With "Text Type - Send Directly to Control", and my new data in T1, it works well sending <HOME><DELETE> .... <DELETE>%T1% to the control. Quote Link to comment Share on other sites More sharing options...
patgenn123 Posted July 30, 2010 Author Report Share Posted July 30, 2010 Did you use Set Focus? I tried your way and without the Set Focus, mine doesn't work. Pat Quote Link to comment Share on other sites More sharing options...
Cory Posted August 2, 2010 Report Share Posted August 2, 2010 You're correct, it will replace but that's easy to deal with. I would Get Control Text then append my new text to that var and Send Text to Control. This will effectively append the field without focusing it. Quote Link to comment Share on other sites More sharing options...
rberq Posted August 2, 2010 Report Share Posted August 2, 2010 Did you use Set Focus? No, I didn't use Set Focus. Just Get Control Text Type | Send Text to Control <GETCONTROL2P:01:CALC.EXE:SciCalcCalculator001:1Edit><TEXTTYPECT:1:<HOME><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE>%T1%> Quote Link to comment Share on other sites More sharing options...
Cory Posted August 3, 2010 Report Share Posted August 3, 2010 Pat, did you read my post from yesterday? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.