Make your iOS or OS X app extensible with JavaScript Core
medium.com
medium.com
Unfortunately AppleScript was the default language, has always been terrible (IMHO), and became more so with OS X. Apple Events took a serious backseat with OS X as well, making it difficult to implement in your app.