autokey

Which clipboard Autokey stores the data with "clipboard.get_selection()"


Autokey function, text = clipboard.get_selection(), which clipboard is the selected data is stored?

I am using Linux Mint 19.1 Cinnamon with Python 3.6. I am searching for the clipboard storage of Autokey's (Python 3) function, text = clipboard.get_selection().

I assume that it is stored in one of the X clipboard's three clipboards, but none of the Gnome compatible clipboard viewers display it.

I need to know how to refer to the particular clipboard in an Autokey, (or Python), script, to view the data before and after it is being altered by a script.

Paste this code in an Autokey3 keyboard macro. (script) and use any key definition to activate it.

In Linux (or any X11 app), the clipboard owner process must be running to # be able to paste the clipboard contents?

Select any text.

import time
import subprocess
import sys

t_xt = ""
keyboard.send_keys("<ctrl>+a")   #  select all
time.sleep(.3)                   #  delay of .3 of a second
t_xt = clipboard.get_selection    #  place selection in clipboard

time.sleep(.3)

keyboard.send_keys(t_xt)         #  retrieves the t_xt I want to know where this is stored and how I can refer it in an Autokey script?
keyboard.send_keys("<ctrl>+a") #  This pastes the contents of a different clipboard.

sys.exit()

Solution

  • According to this documentation, it uses the X mouse selection clipboard.