-
Notifications
You must be signed in to change notification settings - Fork 0
/
ExecuteRawScript.cs
41 lines (34 loc) · 1.07 KB
/
ExecuteRawScript.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using Robin.Core;
using Robin.Core.Attributes;
using System.Windows.Forms;
using System.ComponentModel;
namespace Modules.AhkTest8
{
[Action(Order = 3)]
[Throws("ActionError")] // TODO: change error name (or delete if not needed)
public class ExecRaw : ActionBase
{
[InputArgument]
public string RawScript { get; set; }
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);
}
}
}
}