Thank you for your reply,
Here's what I tried next:
#keyboard.send_keys("<ctrl>+c")
contents=clipboard.get_selection()
contentsList = contents.split()
contentsList.sort()
contents = contentsList.join('\n')
clipboard.fill_clipboard(contents)
keyboard.send_keys("<ctrl>+v")
and the error I'm getting is this:
Traceback (most recent call last):
File "/usr/lib/python2.6/dist-packages/autokey/service.py", line
403, in execute
exec script.code in self.scope
File "<string>", line 5, in <module>
AttributeError: 'list' object has no attribute 'join'
I thought maybe the "List" in contentsList.sort() was doing that so I
changed the name of the variable, but that didn't work either
then I tried this after googling around a bit:
contents = '\n'.join(contentsList)
and that worked! yay
Thanks for putting me on the right track!