Giter Site home page Giter Site logo

modules.ahktest2's Introduction

Modules.AhkTest2

AutoHotkey module for Robin RPA Language

This project is an AutoHotkey module for Robin. It uses the Robin VSIX introduced with V.0.93.

Build the project in VS 2019 (VS 2017 not tested) with Release configuration. You may have to manage NuGet packages for the project, installing When built, copy the DLL you built sharpAHK_505. This a very slightly modified version of LucidMethod's great package, adding only an IsReady() function, which comes in quite handy and is sometimes indispensable, as in the 'ExecRaw' action of this project. Review the code for its use.

N.B.: Both sharpAHK and this project owe their existence to AutoHotkey.Interop. View that page for many examples that can be easily converted to use with Robin.

N.B.: This project is still a work in progress. AutoHotkeyEngine functions remaining to be implemented as Robin Actions:

  • Eval(string)
  • ExecLabel(string)
  • GetVar(string) Done
  • InitializePipesModule
  • LoadFile Done Creates AutoHotkeyEngine, loads script, calls function. Specialized use.
  • LoadEngineAndFile Done Requires existing AutoHotkeyEngine, loads script, calls function. Specialized use.
  • LoadFunctionFile Done Requires CreateAutoHotkeyEngine; creating function file must be done with care.
  • SetVar Done Requires loaded AutoHotkeyEngine. Sets variable in AHK.
  • ExecRawInstant Done Requires CreateAutoHotkeyEngine; no 'IsReady' functionality. Use for one-shot scripts (not GUIS).
  • ExecFunction Done Requires CreateAutoHotkeyEngine and LoadFunctionFile. Up to 10 arguments to function, optional return
  • GetVar Done Requires loaded AutoHotkeyEngine. Gets variable from AHK.

Some or all of these may be implemented as Actions. Whether they are Actions are not, they are available from the sharpAHK DLL, so they may be used.

N.B.: Many names have been changed.

Example Robin Code for the ExecRaw action With this action you can write your AutoHotkey code directly in the Robin script if you like.

set ScriptFile to """
Gui, Add, Edit, w400 h400 vMyEdit, Edit this text to see what happens.
Gui, Add, Button, xp y+5 Default, &ClickMe
Gui, Show, , Ahk Test
return

GuiClose:
Escape::
ExitApp

ButtonClickMe:
Gui, Submit, NoHide
msgbox, 0, Message to Robin, %MyEdit%, 2
ControlSetText, Edit1
ControlSetText, Edit1, Okay`, very good! Try again.
Sleep, 2000
ControlSetText, Edit1
Gui, Submit, NoHide
ControlClick, Edit1
return
"""

Ahk.ExecRaw RawScript: ScriptFile

Example Robin code using the 'LoadScriptAndCallFunction' action AutoHotkey scripts must be custom tailored to be called by C# that most RPA platforms (and Robin) use. Adjust paths to suit. (A sample AutoHotkey script appears below the Robin code.)

Ahk.LoadFile \
    FunctionName:'StartIE' \
    ScriptName:'C:\work\RobinTests\ie_com3.ahk' \
    AhkResult=> AhkResult

Console.Write Message: AhkResult

The script 'ie_com.ahk' is below. The strange syntax is required make the whole thing work. 'SetTimer' is employed to create a pseudo-thread.

#Persistent
; Begin autoexecute section
StartIE()
return
; End autoexecute section
StartIE()
{
	SetTimer, myLabel, -0 ; 'psuedo-thread'
}

myLabel:
wb := ComObjCreate("InternetExplorer.Application")
wb.Visible := True
wb.Navigate("Google.com")
SetTimer ; calling SetTimer with no argument turns it off.
ExitApp

MIT license. Thanks for looking.

Best regards, burque505

modules.ahktest2's People

Contributors

winterlaite avatar burque505 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.