Hi,
I'm sorry but i'm not sure what to call this in a specific word but i'll try to explain it as much as i simply can.
So i have these lines of code for example:
{
Send {a}
Send {b}
Send {c}
}
And i want to be able to use it any time i want inside a single .ahk file without having to type it out again, i hope you understand what i meant.. I swear i used to know the word but i'm not even sure anymore. Thank you!
EDIT: like a function in jquery
Execute a block of code multiple times in a single line? Topic is solved
Re: Execute a block of code multiple times in a single line? Topic is solved
Code: Select all
MyFunc() {
Send {a}
Send {b}
Send {c}
} ;
run % A_WinDir . "/notepad.exe"
WinActivate, ahk_class Notepad
MyFunc()
sleep, 1000
MyFunc()
sleep, 1000
MyFunc()
Re: Execute a block of code multiple times in a single line?
Thanks, i tried that before but i must have mistyped something. Your example helped me!A_AhkUser wrote:see https://autohotkey.com/docs/Functions.htmCode: Select all
MyFunc() { Send {a} Send {b} Send {c} } ; run % A_WinDir . "/notepad.exe" WinActivate, ahk_class Notepad MyFunc() sleep, 1000 MyFunc() sleep, 1000 MyFunc()
Who is online
Users browsing this forum: Google [Bot], imstupidpleshelp, ositoMalvado, Rohwedder, usser and 164 guests