Hi
The following code runs fine in the Script Editor
Application("Typinator").ruleSets.byName("XXX").enabled = true
but when running from the command line it throws an error
$ osascript -l JavaScript -e 'Application("Typinator").ruleSets.byName("XXX").enabled = true'
0:77: execution error: Error on line 1: Error: An error occurred. (-1743)```
can somebody help??
A clash of syntaxes (the role of double quotes in the shell).
This should work, I think:
osascript -l JavaScript -e "Application('Typinator').ruleSets.byName('XXX').enabled = true"
in the end this was not a problem with jxa or the quotes. It's an issue with typinator
so I modifield this code
<key>LSUIElement</key>
<string>1</string>
to
<key>LSUIElement</key>
<string>0</string>
in /Applications/Typinator.app/Contents/Info.plist
so that typinator could be on the dock and appear while doing cmd+tab, but this generated the issue above. In the end I surrender and put it pack to the normal state (dockless).
While Typinator was on the dock, I could successfully run the JXA from Script Editor but not from the command line.
Did you ask the folks that make Typinator?
I have found them to be very responsive.
Support team for typinator replied this is not possible, the best thing is to set a global shorcut.