js-osx-app-examples
js-osx-app-examples copied to clipboard
These are all broken in Mojave
They all get
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'NSGetSizeAndAlignment(): unsupported type encoding spec 'G' at 'GPoint}"size"{CGSize}}' in '{CGPoint}"size"{CGSize}}''
Which seems to happen before many $.NSSomething calls, but certainly $.NSWindow.alloc...
Wondering:
a) can others replicate this? b) ideas on the best way forward? Looks like Apple broke it, but was it intentional? How might we make them aware this was really useful.
... and as soon as I hit "open issue" 10.14.1 comes along which ...[checks] .. has not fixed things
Hey @piersg, thanks for the report. It's been a long time since I've looked at any of the code here. I'd guess Apple has changed some underlying Cocoa API that they all rely on. It would take time to dig into them line by line to see what's causing the crash then read up on the documentation to see what needs to be updated.
I'd love to get it back in working order, but I don't have an ETA on when I'd be able to. I'm making a not of it though. If you find the root cause for any of them crashing, def send a pull request this way.
Now it's issue 44 for JXA-Cookbook too!
https://github.com/JXA-Cookbook/JXA-Cookbook/issues/44
I may have found a workaround (the 10.13 JavaScriptAppleEvents framework appears to work in Mojave and not crash)
... acting on a tipoff from the above issue, I can confirm they all seem to run again in 12.0.1 (you have to right-click and chose "open" twice to get around all that high security and run them). I may not have tested every single one, but it looks like they fixed it.