You can use the replace command like I do on my plugin for the active note.