I can't use this variable correct

Get help with using AutoHotkey and its commands and hotkeys
helliot
Posts: 2
Joined: 02 Feb 2018, 06:55

I can't use this variable correct

02 Feb 2018, 07:06

Hello,

Somebody can help me in this script ? I'm trying to paste a code into a variable, but this don't work.

Code: Select all

MyVar = {Control + V}

WinActivate, Planilha 1 - Excel
Sleep, 333
Send, {Control Down}{c}{Control Up}
WinActivate, Planilha 2 - Excel
Sleep, 333
Send, {Control Down}{l}{Control Up}
Sleep, 333
Send, {Control Down}{v}{Control Up}
Sleep, 333
Send, {Enter}
Sleep, 333
Send, {Escape}
Sleep,333
WinActivate, Planilha 1 - Excel
Send, {Right 2}
Sleep, 333
Send, {Control Down}{c}{Control Up}
Sleep,333
WinActivate, Planilha 2 - Excel
Send, {Right %MyVar%}
User avatar
Exaskryz
Posts: 2876
Joined: 17 Oct 2015, 20:28

Re: I can't use this variable correct

02 Feb 2018, 10:22

"{Control + V}" isn't anything intelligent to AHK. Using such a value in the Send command won't do anything, there's no key as "{Control + V}". Let alone a {Right {Control + V}}

What you'd want is to use either MyVar = {Control Down}{v}{Control Up} like you did use in like 10, or you can use MyVar = ^v where the ^ is the Ctrl modifier.

However, that alone won't work. You would need to change your last line to Send, {Right}%MyVar% or Send, {Right down}%MyVar%{Right up}
helliot
Posts: 2
Joined: 02 Feb 2018, 06:55

Re: I can't use this variable correct

02 Feb 2018, 13:12

None of this works.

I think I'll have to try another way to do this.

Return to “Ask For Help”

Who is online

Users browsing this forum: buchaj, DannyhelMont, Getfree, Google [Bot], PuzzledGreatly and 134 guests