Open andonagio opened 4 months ago
I will try to recreate this, but it might be a while.
In the mean time, you can fake it for the most common case.
Start your script by typing Ctrl+shift+left. In many applications, this will select the word to the left which just happens to be the abbreviation that triggered the script. Then, call clipboard.get_selection() to get the selection into a variable. Don't set Remove typed abbreviation. That text is still selected, so it will get removed when the script emits some text unless you start by emitting something that deselects it first.
This doesn't work for all the triggering settings and applications, but it's a lot better than nothing.
I can work around it, but having access to that function saves me a step in my script. Thank you for looking into it.
AutoKey is a Xorg application and will not function in a Wayland session. Do you use Xorg (X11) or Wayland?
Xorg
Has this issue already been reported?
Is this a question rather than an issue?
What type of issue is this?
None
Choose one or more terms that describe this issue:
Other terms that describe this issue if not provided above:
No response
Which Linux distribution did you use?
Xubuntu 22.04
Which AutoKey GUI did you use?
GTK
Which AutoKey version did you use?
0.96.0
How did you install AutoKey?
*.deb package
Can you briefly describe the issue?
I was working on an Autokey script and ran into trouble trying to use engine.get_triggered_abbreviation(), since I couldn't get any data out of either part of the tuple that it returns. So I created a simple script with just the following line of code and ran Autokey in verbose mode.
abbreviation, trigger_character = engine.get_triggered_abbreviation()
When I opened the text editor, typed my abbreviation, and hit enter, what I saw was the following:
To sanity-check myself, I then added this second line to my script:
print("abbreviation is" + abbreviation)
Sure enough, in the terminal, I get
It doesn't appear that abbreviation and trigger are getting set. In the Set Abbreviations window, I have all of the boxes unchecked except "Omit Trigger Character". That might explain why trigger_character is not set, but why can't I get the triggered abbreviation?
Can the issue be reproduced?
Always
What are the steps to reproduce the issue?
What should have happened?
The "abbreviation" variable should have stored the abbreviation I used for the phrase expansion.
What actually happened?
The "abbreviation" variable is empty
Do you have screenshots?
No response
Can you provide the output of the AutoKey command?
Anything else?
No response