Page 1 of 1

Linking AHK scripts

Posted: 14 May 2021, 07:08
by JC1874
Is there a way to link scripts in separate AHK files?

I have one login script that is used in multiple other scripts, can I call it from the other scripts without including it (the login script) in each one?

Re: Linking AHK scripts

Posted: 14 May 2021, 10:03
by boiler
You can run the script from your other scripts:

Code: Select all

Run, login.ahk
You might want to use RunWait depending on what you plan to do next.

Re: Linking AHK scripts

Posted: 14 May 2021, 10:19
by mikeyww
The #Include directive is also a way to include an external script without having to replicate the code directly in each "host" script. The directive takes care of that.

Re: Linking AHK scripts

Posted: 17 May 2021, 07:50
by JC1874
Thanks! I used RunWait and it works perfectly.