First of all, it might be an easy one. if it is, plz forgive my poor knowledge.
Created 2 functions. But it's not working well.
Checking if the new id is contained in KM variable.
Append the new id into KM variable.
I get this error.
Uncaught TypeError: Cannot read properties of undefined (reading 'eb_done_items')
What I missed?
Thank you in advance!
See for example:
where it is put like this:
Using Keyboard Maestro Variables
What you can do, however, is return a value, from a JS function, to a Keyboard Maestro action. See, on the same wiki page, the section lower down entitled:
Saving Results to Keyboard Maestro Variables
How stupid I was...
I spent 1, 2 hours to find the problem.
I found that the spelling was wrong... (
kmvvar ==> kmvar )
Sorry to bother you and thanks for your time
A perennial problem for programmers I'm afraid.
I forgot to mention...
It's best to never write or edit code directly in Keyboard Maestro.
Write it in a good programming editor like BBEdit or Visual Studio Code
You get nifty tools like code-completion and multiple cursors for refactoring variable names, etcetera.
Another thing that can help is to change the font Keyboard Maestro uses in its code actions.
See the Wiki on Preferences:
manual:Preferences [Keyboard Maestro Wiki]
Search for “font”.