Two phrase case problems that I can't solve

13 views
Skip to first unread message

JC

unread,
Jul 27, 2021, 12:55:30 PM7/27/21
to autokey-users
  1. Why does "Match phrase case of typed abbreviation" always check the "Ignore case of typed abbreviation" box? Aren't they mutually exclusive of each other? It's pretty misleading.
  2. Also, I dislike how the matching method works. For example, I could map in AutoHotkey:
:?*:;afaik::as far as I know

This yields the following:
  • Type ;afaik to spit out "as far as I know"
  • Type ;Afaik to spit out "As far as I know"
But in AutoKey, if you try to type ;afaik with case-matching turned on, the "i" is lowercased EVEN WHEN you already told AutoKey to type a capital "I" in the output text field (above Phrase Settings). What gives?

jos...@main.nc.us

unread,
Jul 28, 2021, 3:14:19 AM7/28/21
to autoke...@googlegroups.com
I had to stare at this one a few minutes.

1) looks like a bug to me, but maybe I'm missing something. I'll ask on
Gitter.

AutoKey does what it's supposed to do with the cases, but doesn't think
about caps that are in the phrase to start with. I think it just knows
about all caps, no caps, and, maybe, a leading cap. I've never really
played with that feature. I

If you want it to work differently, you can file an enhancement request.
If you do, be sure to specify very clearly exactly how you want it to
work.

Something like this needs a number of people to look at it to see what the
consequences might be.

The main problem with something like this is that it has to be done in a
way that doesn't break a ton of exiting phrases. It would probably require
a configuration switch in the GUI that defaults to off.

>
>
> 1. Why does "Match phrase case of typed abbreviation" always check the
> "Ignore case of typed abbreviation" box? Aren't they mutually exclusive
> of
> each other? It's pretty misleading.
> 2. Also, I dislike how the matching method works. For example, I could
> map in AutoHotkey:
>
> :?*:;afaik::as far as I know
>
> This yields the following:
>
> - Type ;afaik to spit out "as far as I know"
> - Type ;Afaik to spit out "As far as I know"
>
> But in AutoKey, if you try to type ;afaik with case-matching turned on,
> the
> "i" is lowercased EVEN WHEN you already told AutoKey to type a capital "I"
> in the output text field (above Phrase Settings). What gives?
>
> --
> 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/ff57a413-994f-4241-bfb9-4a320422ca34n%40googlegroups.com.
>


Johnny Rosenberg

unread,
Jul 28, 2021, 2:36:55 PM7/28/21
to autoke...@googlegroups.com
Den ons 28 juli 2021 kl 09:14 skrev <jos...@main.nc.us>:
I had to stare at this one a few minutes.

1) looks like a bug to me, but maybe I'm missing something. I'll ask on
Gitter.

AutoKey does what it's supposed to do with the cases, but doesn't think
about caps that are in the phrase to start with. I think it just knows
about all caps, no caps, and, maybe, a leading cap. I've never really
played with that feature. I

If you want it to work differently, you can file an enhancement request.
If you do, be sure to specify very clearly exactly how you want it to
work.

Or use this very simple workaround (which I use myself):
Just create two different phrases. Trigger one of them with ”Afaik” and the other one with ”afaik”.

If there are many phrases like this, there will be twice as many with that workaround, but on the other hand you only create them once. Once you are using them it's the exactly same procedure.

Another workaround would probably be to write a script rather than a phrase. Uncheck ”Remove typed abbreviation” and instead let the script do a Ctrl+Shift+← Ctrl+c and then determine if the first letter is upper case or not, and type the text accordingly (or first put in the clipboard and then spit it out with Ctrl+v.
The result will be the same but more flexible, fewer scripts (than phrases in the first workaround), but more code. So both advantages and disadvantages, that is.

Actually you could have just one script for a ton of phases like that, that you trigger with a ton of different abbreviations. Then you let the script determine exactly which one was used and then type one of the many phrases in the same script.

Or here's another one:
Make a script that is triggered by a lot of different abbreviations. Let the script determine which one was used, then search for it in a text file in which every line contains the abbreviation, then a TAB character and then the actual sentence or phrase, then type that.

On the other hand, if you can write scripts in Python, maybe you could rather change the AutoKey source code to your liking and then either release it as an AutoKey fork or just suggest it as an update.


Kind regards

Johnny Rosenberg

 

jos...@main.nc.us

unread,
Jul 29, 2021, 12:03:17 PM7/29/21
to autoke...@googlegroups.com
Those are really good suggestions. Simpler is better.

If you wanted to, you could use a Python dictionary instead of a text
file, but it would involve editing the script instead of just a text file
when you want to make changes.

There's a big difference between between knowing how to write scripts in
Python and being competent enough to modify AutoKey.

Joe
>> https://groups.google.com/d/msgid/autokey-users/aaa31398d00c92bb435d6163bde99374.squirrel%40main.nc.us
>> .
>>
>
> --
> 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/CADo7T4csJkw0rr8qtZnpMjuoRFwPCtAb4negugw2N1fBcmUSTQ%40mail.gmail.com.
>


Johnny Rosenberg

unread,
Jul 29, 2021, 1:22:39 PM7/29/21
to autoke...@googlegroups.com
Den tors 29 juli 2021 kl 18:03 skrev <jos...@main.nc.us>:
Those are really good suggestions. Simpler is better.

If you wanted to, you could use a Python dictionary instead of a text
file, but it would involve editing the script instead of just a text file
when you want to make changes.

Maybe you could use a text file that is read into a dictionary when the script is running? But that would probably make it slow if the text file is big.
 

There's a big difference between between knowing how to write scripts in
Python and being competent enough to modify AutoKey.

I think that depends on what part of AutoKey you want to modify, though, but yes, I agree for the most part.


Kind regards

Johnny Rosenberg

Reply all
Reply to author
Forward
0 new messages