With the latest update to XProtect at the beginning of December Apple (silently!!!) now requires any AppleScript done with NSAppleScript to be initialized on the main thread. Otherwise the app hangs! Subsequent AppleScripts can be run in a thread.
Yup. I do not know what these people are thinking anymore. Really, it’s only security theater. And it took me only a couple of minutes to work out that both non-threaded NSAppleScript and osascript do work.
For me it looks usually more like the old senior developers retired and the new developers don’t yet know all the reasons why you do something a certain way. Like that dispatch_sync to main thread may be bad in a multi threaded app.
Now we have to run a small AppleScript doing nothing in main thread on startup as a workaround.