Accessing VSCode variables from Keyboard Maestro

Hi Team,

VSCode has a number of variables: Visual Studio Code Variables Reference
Is it possible to access them from within Keyboard Maestro ? Through apple script perhaps ?


Hey @maindoor,

VSC has no AppleScript support whatsoever.

Shame on Microsoft...

But then I don't think I've seen any Electron apps that have AppleScript support.

So I'm afraid you're out of luck on this one.

Complain to M$.


1 Like

Not sure that that would be possible ...

Any script-driving of an app that is essentially an embedded browser would really have to take place inside its own JS evaluation space – more or less isolated by design.

Safari and Google Chrome can run JavaScript via Apple Events, so it stands to reason that Electron Apps could have a similar mechanism.

Safari and Google Chrome also have their own AppleScript dictionaries providing access to various functions.

I suspect where there's a will there's a way, but who if anyone has the will?

A lot of people are clamoring over ShortCuts, so they may find their way into Electron apps.


Aww... I just wanted to automate a task where I need just the line-number of the current cursor position.

I have every thing else sorted out except for this line number.

Hey Kabali,

The only thing I can think of is to write a custom function for VSC that gets your line number and writes it to a file.

IF you can do that then you can read the file with Keyboard Maestro and go-to-town.