-1

Is it possible for me to use a Send("{LEFT}") and Send("{RIGHT}") with the use of the value of my inputBox? My code is:

$input = InputBox("Brightness", "Set Brightness to:", "", " M", -1, -1) _UIA_action($oUIElement,"setfocus");focus on my control

It's not working when I used

Send("{RIGHT" & $input &"}")

Or

Send("{LEFT" & $input &"}")

Is there other way to do it?

Yay
  • 3
  • 7
  • You have forgot the space between LEFT/RIGHT and the number (your input). *Send("{LEFT " & $input & "}")* –  Jun 20 '18 at 06:57
  • @McBarby still not working for me. I don't know what's the problem :( – Yay Jun 20 '18 at 07:55
  • Do you really know, what Send("{LEFT n}") does? It hits the "LEFT-ARROW-KEY" n-times. It moves the cursor in an input/edit control n-times to left. If a non-edit control has the focus, the movement is related to the application. –  Jun 20 '18 at 09:26
  • I do know what it does. But I don't think it will move the cursor to the left/right. It will just send left/right arrow keys. I am trying to use the return value of my `$input` as a variable for the count of left/right keys which in my code doesn't work. – Yay Jun 20 '18 at 09:52

1 Answers1

0

Your explanation is quite confusing, but are you trying to repeat the Send key x times as defined in the input field? If so, this would be your code:

For $i = 1 To $input
    Send("{LEFT}")
Next
Timppa
  • 353
  • 2
  • 7
  • 24