autoekey in libreoffice

41 views
Skip to first unread message

Duns

unread,
Jun 25, 2021, 2:35:20 AM6/25/21
to autokey-users

I have Linux and there was the problem of bad expanded abbreviations in LibreOffice. This problem was fixed by setting "paste using clipboard".
But recently instead of the right phrase appear many times (3 or 4 times) a bad content, that is the clipboard content: very annoying.
This behavior is not always, but quite often.
Thanks!

jos...@main.nc.us

unread,
Jun 25, 2021, 3:13:46 AM6/25/21
to autoke...@googlegroups.com
That really shouldn't happen with using Paste using clipboard (Ctrl+V).

However, if was going to happen, LibreOffice is where I would expect it.

First, try your phrase in a text editor window to be sure it works in a
low-overhead application.

There are two things you can do.

1) Run an AutoKey trace to be sure that AutoKey is doing the right things
with LibreOffice.
https://github.com/autokey/autokey-python2/wiki/Problem-Reporting-Guide

If AutoKey is doing the wrong thing, then post the trace here and we'll
take a look.

2) If it is doing the right thing, but LibreOffice isn't cooperating, then
write a script that pastes your phrase from the clipboard.

delay = 0.1
time.sleep(delay)
clipboard.fill_clipboard("")
time.sleep(delay)
clipboard.fill_clipboard("the text of your phrase")
time.sleep(delay)
keyboard.send_keys("<ctrl>+v")
time.sleep(delay)

See if that works. If not, try gradually increasing delay and see if that
helps.

Clearing out the clipboard first, as this script does, should be
unnecessary, but we want to start out with overkill. If it works, you can
try it without the first delay and paste an see if it still works.

delay = 0.1
time.sleep(delay)
clipboard.fill_clipboard("the text of your phrase")
time.sleep(delay)
keyboard.send_keys("<ctrl>+v")
time.sleep(delay)

Joe
> --
> You received this message because you are subscribed to the Google Groups
> "autokey-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to autokey-user...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/autokey-users/47275f22-9e78-473f-88bc-3d0498293de1n%40googlegroups.com.
>


Duns

unread,
Jun 25, 2021, 4:28:33 AM6/25/21
to autokey-users
Uhm, usually it happens only in LibreOffice, but just few seconds ago it happened also in Firefox: the clipboard content instead of the expected phrase.

jos...@main.nc.us

unread,
Jun 25, 2021, 5:31:33 AM6/25/21
to AutoKey List
That's the other most likely app to have this issue - especially in the
address bar/location field.

Joe

> Ops... usually it happens only in LibreOffice, but just few seconds ago
> it
> happened also in Firefox.
>
> Il giorno venerdì 25 giugno 2021 alle 09:13:46 UTC+2 Joe ha scritto:
>

Duns

unread,
Jun 25, 2021, 7:16:00 AM6/25/21
to autokey-users
I attach a log: the bug happened in the last time (therefore last rows, I suppose)
autokey.log

jos...@main.nc.us

unread,
Jun 25, 2021, 8:49:15 AM6/25/21
to autoke...@googlegroups.com
Looks like AutoKey is working fine, AFAIK.

Try the scripts I provided and see if slowing things down helps.

Joe
> https://groups.google.com/d/msgid/autokey-users/d7355743-28be-45dd-81a7-357b09298748n%40googlegroups.com.
>


Duns

unread,
Jun 25, 2021, 9:57:33 AM6/25/21
to autokey-users
Ok, I will try but where should I put the script?

jos...@main.nc.us

unread,
Jun 25, 2021, 12:53:49 PM6/25/21
to autoke...@googlegroups.com
Open the AutoKey main menu.

Select New->Folder
And give it a name such as My_Scripts.


On the left, you should see a file tree of scripts and phrases.

Select My_Scripts (or whatever you called it).

Select New->Script
This will create a new script called "New Script" in the "My_Scripts" folder.

Right click on that new script and select Rename and give it a name that
makes sense to you the same way you would name a phrase.

Go into my original email to you with the scripts in it and copy the first
one to your clipboard.

Go back to the AutoKey Menu where you just were with your new script
selected.

On the top right, you'll see a big empty panel with
#Enter script code
in it.

Click on that text anywhere.

Type Ctrl+A (the control key and A at the same time).
This should select/highlight the whole text.

Type Ctrl+V (the control key and V at the same time).
This should paste the script from your clipboard into the panel, replacing
the comment
#Enter script code
that was there before.

Now, you have a new script named whatever you named the new script in the
steps above.

Below that panel are Script Settings where you can add a trigger
abbreviation and/or hotkey and other settings for your new script just
like you would for a new phrase.

When you're done, select Save from the main menu to save your changes.

You have just created your first script and saved it in your new scripts
folder.

You can begin using it immediately by typing its trigger abbreviation or
pressing its hotkey exactly as you would invoke a phrase.

If you need to edit it later (e.g. to change the delay time), you just
open its folder and select the script name on the left panel of the main
autokey window. The body of the script will appear in the top right panel
where you pasted it before and you can edit it right there using a simple
editor built into AutoKey.

This editor has some issues displaying the text cursor and, if you have a
dark desktop theme (like I do), some of the text of your script may be a
bit hard to read. If you run into that later, we can deal with it then.

Now, you know how to create, edit, and invoke a script!

Wen you need to create another one, you can copy the one you just created
and repeat all the steps above using the same new folder we created and
giving your new script a new name, new text and triggers, etc.

----

After we're done with this immediate issue, take a look at our wiki

https://github.com/autokey/autokey/wiki

Where there are quite a few sample scripts. To really understand them,
you'll have to learn some very simple concepts of the Python language (a
very small subset to get started) and take a look at our API documentation
to see how you tell AutoKey to do things in your script, but you can do
all of this at your convenience and at your own pace later.

Joe

> Ok, I will try but *where* should I put the script?
> https://groups.google.com/d/msgid/autokey-users/33f4a6f1-3778-4e87-acb3-a2f8f8b2ad1fn%40googlegroups.com.
>


Reply all
Reply to author
Forward
0 new messages