Error: Variable not found (SendInput %name%)

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
User avatar
whats_up
Posts: 89
Joined: 29 Apr 2018, 05:09

Error: Variable not found (SendInput %name%)

03 May 2024, 18:29

I don't get it, why my variables, which are written globally, cannot be found when I press a specific key to type a text.

Here is my simple code:

Code: Select all

name := "JOHN"

#HotIf WinActive("Notepad")

q::{
    SendInput %name%
}
:think:
User avatar
mikeyww
Posts: 28869
Joined: 09 Sep 2014, 18:38

Re: Error: Variable not found (SendInput %name%)

03 May 2024, 19:59

Hello,

AHK v2 uses :arrow: expressions throughout all scripts.

Code: Select all

#Requires AutoHotkey v2.0
name := 'JOHN'
q::SendText name

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: DavidP, mikeyww, TomDonovan, vanove and 88 guests