Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Autohotkey Single line code?

I have simple question that i can`t find answer by searching internet.
How can I make my lines into one (single) line?

for example this is a working code

right:: 
Send, ^s
Reload 
Send, hello world

and this is not

right::Send, ^s::Reload::Send, hello world
like image 906
Marco Polo Avatar asked Oct 12 '25 08:10

Marco Polo


1 Answers

Autohotkey doesn't have a statement terminator like the ; in c and javascript.

However if your goal is compact and readable code, refactoring using functions can help you achieve this.

Your code expressed in one line:

right::alpha("^s", "hello world")

alpha(text1, text2) {
  send % text1
  tooltip "reload" will interrupt your script. Any code following "reload" may not execute
  send % text2
}
like image 94
Jim U Avatar answered Oct 14 '25 19:10

Jim U