public void can_load_and_execute_file_with_function() { ahk.LoadFile("functions.ahk"); bool helloFunctionExists = ahk.FunctionExists("hello_message"); Assert.True(helloFunctionExists); var result = ahk.ExecFunction("hello_message", "John"); Assert.Equal("Hello, John", result); }
public void Can_load_and_execute_file_with_function() { _ahk.LoadFile("functions.ahk"); var helloFunctionExists = _ahk.FunctionExists("hello_message"); Assert.IsTrue(helloFunctionExists); var result = _ahk.ExecFunction("hello_message", "John"); Assert.AreEqual("Hello, John", result); }
public void can_auto_exec_in_file() { //loads a file and allows the autoexec section to run //(sets a global variable) ahk.LoadFile("script_exec.ahk"); string script_var = ahk.GetVar("script_exec_var"); Assert.Equal("jack skellington", script_var); //run function inside this file to change global variable //(changes the perviously defined global variable) ahk.ExecFunction("script_exec_var_change"); script_var = ahk.GetVar("script_exec_var"); Assert.Equal("zero", script_var); }
public Profile(string name, Action <string, bool, uint> callback) { profileName = name; profileCallback = callback; ProfileEvent profileEventDelegate = profileEventCallback; IntPtr eptr = Marshal.GetFunctionPointerForDelegate(profileEventDelegate); ahkThread.LoadFile("ProfileThread.ahk"); ahkThread.Eval(String.Format("ph := new ProfileHandler({0})", eptr)); }
private void InitBindMode() { bindModeThread = new AutoHotkeyEngine(); BindModeEvent bindModeEventDelegate = BindModeEventCallback; IntPtr eptr = Marshal.GetFunctionPointerForDelegate(bindModeEventDelegate); bindModeThread.LoadFile("BindModeThread.ahk"); var tv = bindModeThread.GetVar("tv"); bindModeThread.ExecRaw(String.Format("bh := new BindHandler({0})", eptr)); }
public void LoadAHKScript() { // Directory string m_appdatapath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); string m_foldername = "Bonnyfication"; string m_FileName = "Keybinds_Script.ahk"; string m_Fullpath = Path.Combine(m_appdatapath, m_foldername, m_FileName); //_AHK.Reset(); _AHK.LoadFile(m_Fullpath); }
public AhkFunctions() { _ahk = AutoHotkeyEngine.Instance; _ahk.LoadFile("functions.ahk"); }
public void LoadFile(string filePath) { ahk.LoadFile(filePath); }