You might want to take a look at my Insert APT Link UserScript, which demonstrates how to add a button to the toolbar and associate an action with it. It also demonstrates how to interact with the editor itself.
Nathan Osman
- 23.3k
- 11
- 61
- 107