I'm trying to write a Wordpress plugin. I will get counts words which in WP's Tinymce editor.
Basically, it's a word counter which counting long of your post and giving you this message in a meta box
Your post has 450 words
Where "content" is the id of your textarea.
Similarly, if you wanted to get just the selected (highlighted) text in the TinyMCE text area you would do:
The full API is here: http://tinymce.moxiecode.com/wiki.php/API3:class.tinymce.Editor
Be sure to call this stuff only after TinyMCE has loaded on the page.