I'm trying to build a script that will add the currently selected text to the end of a file. So far it looks like cat selected_text >> quotes.txt.
Is there any way, either in command line or in C/C++ to get the currently selected text from the currently active window?