[Autohotkey-jk] How to send a variable to my ElectronJS app from Autohotkey-JK? Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
func
Posts: 47
Joined: 20 May 2016, 20:52

[Autohotkey-jk] How to send a variable to my ElectronJS app from Autohotkey-JK?

11 Apr 2022, 13:29

I'm using Autohotkey-JK, which is a javascript-language implementation of AHK v2. I'm also making an ElectronJS app alongside it to be the "GUI", while AHK-JK is the "brain" of the app. The problem is how do I communicate between AHK-JK and the ElectronJS front end or back end?

In a nutshell I'm trying to capture what a user types in a third party application and display it to them in a tooltip that follows the mouse. The tooltip has to be HTML/CSS so I can use complex formatting that native windows tooltips simply don't have.

So far I brainstormed four theoretical ways, I'm unsure which is practical or best

1) Send messages from AHK-JK to the ElectronJS node backend somehow
2) Send messages from AHK-JK to the renderer.js (ElectronJS) frontend somehow. I tried simply including the .jk file as a .js script in an html file script tag, but then it doesn't have access to any AHK functions as they are undefined.
3) Manipulate the innerHTML of the ElectronJS app somehow with AHK-JK.
4) Write my variables to a .json file from AHK-JK continually, and continually read the JSON file using ElectronJS somehow
lexikos
Posts: 9635
Joined: 30 Sep 2013, 04:07
Contact:

Re: [Autohotkey-jk] How to send a variable to my ElectronJS app from Autohotkey-JK?  Topic is solved

14 Apr 2022, 19:03

AutoHotkey-jk and ElectronJS are not inherently compatible, any more than AutoHotkey itself and ElectronJS.

jk uses JsRT (i.e. Chakra) for its JavaScript engine. I think ElectronJS uses Chromium. AutoHotkey and Chakra have a high level of support for interop via COM; Chromium does not.

Although jk relies on some JsRT mechanisms, Exo is built on a similar premise but with Internet Explorer as the host. Of course, Internet Explorer is obsolete.

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: ThePeter and 30 guests