I'm trying to create a JXA script that accesses a local variable. To do that, I need to capture the KMINSTANCE. But since this is a global macro, I want to use const app = Application("Google Chrome") rather than const app = Application.currentApplication()
The former gives me "Error: A privilege violation occurred. (-10004)" when I try to access the KMINSTANCE. Everything is fine if I use a global KM variable, but that's poor.
SOMEONE must know what I'm doing wrong. And thank you
I wouldn't even recognize JXA if I saw it, so feel free to ignore my ideas. I won't mind. But I googled it and found a web page with a similar issue:
And I also recall that privilege problems with KM are also caused by not having the correct KM or macOS apps loaded into the System Preferences / Security & Privacy / Privacy / applist.
So my chances of being right are under 10% since I hardly know what I'm talking about so feel free to ignore me.