Calling functions from another script

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
lp230889
Posts: 16
Joined: 06 May 2016, 05:49

Calling functions from another script

02 Feb 2018, 05:25

I'm trying to split my code from 2 large scripts into multiple smaller scripts.
At the moment I'm using #Include to access functions which works but i find it hard to read.

Is It possible to access functions on another script using:
ScriptName.FunctionName() or similar.
Thanks
cocobanana
Posts: 19
Joined: 31 Oct 2017, 05:43

Re: Calling functions from another script

02 Feb 2018, 05:33

You can do this with Autohotkey_H..

Here is an example from the Helpfiles

Code: Select all

dll:=AhkThread("#Persistent`nMyFunc(param){`nSleep 10000`nMsgBox `% param`n}")
MsgBox % dll.ahkFunction["MyFunc","test"]

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot] and 360 guests