I already wrote a code which sets me able to get the selected text in TextEdit.app or other few apps. My problem is I need to get the selected text in any app. It seems the accessibility API is not capable to get the selected text of every app as I can evidence by using the Accessibility Inspector.
This first image shows how the accessibility API can get the selected text as an attribute from the AXTextArea in the TextEdit.app:
Then I try to get the same information from TextWrangler.app but it won't work the same way.
Is there an alternative to get the selected text information from any app or at least most of them?