https://yhz.me/posts/osx-using-javascript/