What steps will reproduce the problem?
1. Assign a hotkey to a script using clipboard.get_selection.
2. Save, and close the configuration window.
3. Try using the script on selected text.
This problem typically does not occur when AutoKey is first started, but
later it happens consistently.
What is the expected output? What do you see instead?
The script should successfully get the selected text, but it gives an error
instead.
What version of the product are you using? On what operating system?
AutoKey 0.70.2 on Ubuntu Hardy.
Please provide any additional information below.
The strange thing is that having the AutoKey configuration window open
guarantees that the error will not happen, and the script will work just
fine. The error is not entirely predictable when the window is closed, but
never happens when it is open. If I have the problem and then open the
configuration window and try the hotkey again, the script will work fine,
and if I close it, the error behavior will immediately return. If I keep
the configuration window open all day, the error never happens.
I think I have experienced this issue all along, but with the frequent
improvements to AutoKey's hotkey handling I had hoped it was just a glitch
that would get worked out in the course of things.
Here is the log from executing "Selection Test" from the "Sample Scripts"
folder.
DEBUG - iomediator - <alt> pressed
DEBUG - iomediator - <ctrl> pressed
DEBUG - service - Key: u't', modifiers: ['<alt>', '<ctrl>']
INFO - service - Matched hotkey phrase/script with prompt=False
DEBUG - service - Script runner executing: Script('Selection Test')
DEBUG - iomediator - <ctrl> released
DEBUG - iomediator - <alt> released
ERROR - service - Script error
Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/autokey/service.py", line 378, in
execute
exec script.code in self.scope
File "<string>", line 1, in <module>
File "/usr/lib/python2.5/site-packages/autokey/scripting.py", line 679,
in get_selection
return self.text.decode("utf-8")
AttributeError: 'NoneType' object has no attribute 'decode'
If this is just due to Hardy having an older Xorg, then I can just leave
the configuration window open until I upgrade.