Quick note: I’ve been playing around with Writely for a while, and recently decided to use it to write out one of my midterms. Everything’s working great, with the exception of a word count per selection – which is necessary when you have per-answer word count limits. Here’s a bookmarklet that will do per-selection word count (an estimate, but not a bad one)–

tags: , ,

WordPress doesn’t seem to allow javascript links, so the code itself is after the jump

javascript:(function() {function getSel(win) {if (win.getSelection) return win.getSelection(); else if (win.document.getSelection) return win.document.getSelection(); else if (win.document.selection ) return win.document.selection.createRange().text;} var frame = document.getElementById('wys_frame'); var content = getSel(frame.contentWindow).toString().split(%22 %22); alert(content.length + %22 word(s) in selection%22);})()

Copy paste into a bookmark’s location field (only tested in Firefox; Writely isn’t quite there yet for Opera) and invoke whenever needed. Many thanks to Ben Newman for help with getting text selection.

Leave a Reply