예제 #1
0
        public override void Execute(ActionContext context)
        {
            try
            {
                var ahk = new AutoHotkey.Interop.AutoHotkeyEngine();
                ahk.LoadFile(ScriptName);
                ahk.ExecFunction(FunctionName);
                while (ahk.IsReady() == true)
                {
                    System.Threading.Thread.Sleep(100);
                }
                ahk.Reset();
                // MessageBox.Show("Engine finished.");
                AhkResult = ("Finished successfully.");
            }
            catch (Exception e)
            {
                if (e is ActionException)
                {
                    throw;
                }

                throw new ActionException("ActionError", e.Message, e.InnerException);
            }

            // TODO: set values to Output Arguments here
        }
예제 #2
0
        public override void Execute(ActionContext context)
        {
            try
            {
                var ahk = new AutoHotkey.Interop.AutoHotkeyEngine();
                ahk.ExecRaw(RawScript);
                while (ahk.IsReady() == true)
                {
                    System.Threading.Thread.Sleep(100);
                }

                ahk.Reset();
                // MessageBox.Show("Engine finished.");
            }
            catch (Exception e)
            {
                if (e is ActionException)
                {
                    throw;
                }

                throw new ActionException("ActionError", e.Message, e.InnerException);
            }
        }