Hi, thanks in advance for all help.
I would like to run an AHK script using “Run Auto Hot Key script”, set variables, and pass them to UiPath.
In the past I’ve been able in Visual Studio to pass variables from both AutoHotkey.Interop.Dll and AutoHotKey.dll to Visual Basic. There the syntax seems to be different than what I’ll need here. Here’s a sample of a working .vb example in VB.NET, using a form with a button to execute this code:
Imports AutoHotkey.Interop Public Class Form1 Public ahk = AutoHotkeyEngine.Instance Public vbString As String = "" Private Sub btnTest_Click(sender As Object, e As EventArgs) Handles btnTest.Click ahk.ExecRaw("MsgBox, Hello World, from AHK!") 'programmatically set variables ahk.SetVar("x", "1") ahk.SetVar("y", "4") ahk.SetVar("ahkstr", "this value to be passed to .NET") vbString = ahk.GetVar("ahkstr") MessageBox.Show("From the AHK engine I got " & vbString) 'execute statements ahk.ExecRaw("z:=x+y") 'return variables back from ahk Dim zValue As Integer = ahk.GetVar("z") MessageBox.Show("Value of z is " & zValue.ToString) ' "Value of z is 5" End Sub
Can someone tell me how I might run essentially the same code in an AHK script that UiPath will accept, and how to pass the variables “ahkstr” and “z” to a UiPath MessageBox activity?