You need a bit more work to properly get the selected text. I use this subroutine:


// getselec.js Get selected text
// Written: 2013-05-30 by James Alarie
// ...