Jump to content

SEND keystrokes using a variable


Recommended Posts

I am trying to use a variable in my SEND function.

Help example says:

$n = 4

Send("+{TAB " & $n & "}")

My code:

$location=7 ;I assigned this value using StringInStr()

;First I do a Find of certain text in Notepad, then I try the following.

Send('{ESC}{RIGHT}{SHIFTDOWN}{RIGHT " & $location & "}{SHIFTUP}')

It is only selecting one character instead of seven, when it runs.

What else should I try?

(Using AutoIt 3.2.10.0 on XP Home)

Link to comment
Share on other sites

I think the problem was you weren't using the same quotes at the start, middle and end.

You used ' " " '

I used " " " "

I could have also used ' ' ' ' ;)

Ahh... now the 'fog' has cleared. I couldn't remember what the & was doing; string concatenation!

Thanks again.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...