0

Can an external program ask a GUI application (for example: Gedit, Firefox) to select all the text of the active widget?

--

EDIT: I am looking for the equivalent of pressing Control+A, because blindly sending key presses has proven to be not reliable, as in my former question: `xdotool` does not send keys

EDIT2: I am assuming that the GUI app already has focus.

Eleno
  • 1,849
  • Yes, but the program must ask the desktop environments clipboard, not t he program itself. – eyoung100 Jul 10 '15 at 16:49
  • What program can do that? – Eleno Jul 10 '15 at 16:57
  • I knew that there was xsel, but xsel only lets you access something that has already been selected. I am looking for the equivalent of Control+A in many programs, but without sending key presses. – Eleno Jul 10 '15 at 17:14
  • As far as I know that isn't possible as to select text, the app you're selecting from must have Active Focus. There are many ways t set/get focus but you still need to know which text you selected. You do that by examining the contents of the clipboard etc. – eyoung100 Jul 10 '15 at 17:21
  • I forgot to say that the app has focus. So, once a GUI app has focus, how can you tell it to select all the text in the current widget? – Eleno Jul 10 '15 at 17:26
  • You must use Control + A, then scan the clipboard – eyoung100 Jul 10 '15 at 17:28
  • I explicitly said that I don't want to use Control+A (and I actually can't: http://unix.stackexchange.com/questions/214909/xdotool-does-not-send-keys) – Eleno Jul 10 '15 at 17:42
  • Then you need to find a different way, as Control+A is the only way to select Text – eyoung100 Jul 10 '15 at 17:44

0 Answers0