#1
|
|||
|
|||
Moving cursor position to previous field
Is there a way to change the cursor position? I'm using secureCRT 7.3.3 and VBS.
I need to be able to move the cursor from the current field to the one preceding it. Manually, the only way to move the cursor back is with the Up Arrow key. I tried recording a script, used Up Arrow to get to the desired field, and got this: crt.Screen.Send chr(27) & "[A" & chr(13) But playing it back does not do anything. |
#2
|
|||
|
|||
Hi ShawnVW,
So it sounds like you are working inside some menued application, correct? It might be difficult to accomplish this task via scripting because the tasks are dependent on timing. You have to be able to detect the cursor is in the "wrong field" before pressing the Up arrow would accomplish the objective. How do you know when the cursor is in the "wrong" field?
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#3
|
|||
|
|||
It depends on whether the script changes the value in the Zip Code field. If it does, the screen automatically fills in the City, State, and Country fields, and the cursor proceeds to Phone Number. That's the "wrong field" because I occasionally need to go back and change City, State, or Country.
I did find a workaround: I can change the Zip, finish and save the screen, then start over. This time the script won't change the Zip, so it can tab down to City, State, or Country and change it if needed. If you still know a way of "tabbing backwards", I'm sure it will come in handy at some point. |
#4
|
|||
|
|||
Hi ShawnVW,
Thanks for the clarification. I am glad to hear you found a workaround. You probably would use SendKeys() instead of Send() to simulate the up arrow: Code:
crt.Screen.SendKeys "{UP}"
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
![]() |
Tags |
scripting , vbscript |
Thread Tools | |
Display Modes | Rate This Thread |
|
|