js-osx-app-examples icon indicating copy to clipboard operation
js-osx-app-examples copied to clipboard

These are all broken in Mojave

Open piersg opened this issue 6 years ago • 4 comments

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.

piersg avatar Nov 21 '18 03:11 piersg

... and as soon as I hit "open issue" 10.14.1 comes along which ...[checks] .. has not fixed things

piersg avatar Nov 21 '18 03:11 piersg

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.

tylergaw avatar Nov 28 '18 07:11 tylergaw

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)

piersg avatar Jun 07 '19 05:06 piersg

... 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.

piersg avatar Nov 24 '21 22:11 piersg