Jump to content

Recommended Posts

Posted

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)

Posted

Try this:

$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}")
Posted

Try this:

Send("{ESC}{RIGHT}{SHIFTDOWN}{RIGHT " & $location & "}{SHIFTUP}")
Thanks, working now.

I was using Send(' for some simple stuff, and it works. Seems double quotes are required for more complex stuff then.

Posted (edited)

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 ' ' ' ' ;)

Edited by LongBowNZ
Posted

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.

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
  • Recently Browsing   0 members

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