前にGoogle ChromeをAppleScriptで操作する - DiaryExceptionという記事を書いたが、1つ見落としていたことがあった。 AppleScriptの中にJavaScriptを書いて、表示中のWebページを加工することが出来る。 Safariを操作するAppleScriptの中にはdo JavaScriptという命令を書くことが出来、この命令でSafariに表示されているWebページをJavaScriptで加工することが出来る。Google Chromeだとこの命令はexecute javascriptという名前で実装されている。 例として、bitbucketのページを開き、ログインをするという動作をAppleScriptで記述した。 bookmarkletでも同様のことは出来るが、AppleScriptで記述することの強みとして、Webブラウザの外側の様々なア