KM8: autocomplete variable names acting weird

I'm converting a subroutine macro I have to use Instance variables instead of global variables. Pretty much just going down the macro pasting Instance[space] in front of the macro names.

If I use a variable named TestVariable2, insert the Instance, then use a shorter variable, but where the first few letters match, if I insert Instance in front, then move the mouse out of focus of the text field, it'll autocomplete the longer variable name in the Instance and the old variable name.

attached is a screen shot showing what I'm talking about.

Some thoughts:

  • Local/Instance Variables are still in a state of flux.
  • Peter has removed the initial single-letter prefix, but we've suggested some replacement.
  • In Ver 8.0 they did NOT work in Prompt User actions
  • So, other than testing, I would not make any changes to production macros until things settle down. :wink:
  • I also dislike the way autocomplete works. It generally gets in my way.
    • So I have turned it off using this:
      defaults write com.stairways.keyboardmaestro.editor AutomaticCompletion -bool NO

I personally strongly dislike spaces in variable names, and have suggested "Local__" and "Instance__" instead, or at least in addition to. But even then I'll probably wait until we have the single-letter prefixes fully working.

For more discussion, see:
KM8: Local and Instance Variables

Yeah, I was reading most of the threads yesterday. Somebody’s got to be the goat and go first :slight_smile:

Not working in Prompt User actions is OK, these subroutines don’t use those.

Most of the other points I agree with, especially spaces in variable names. I’m OK changing these names multiple times since I’m only going to use them in these subroutines at the moment… The variables aren’t used a bunch.

thanks for the tip on autocomplete. I’ll probably turn it off as well.

Thanks!

Good luck, and let us know how it goes, and if you need any further help.

I know there are some completion issues. I tried duplicating this and could not, can you explain exactly what is required to duplicate the issue?

Peter, I think he did in his OP:

Here is an animated GIF showing problems with autocomplete in the Global Find/Search box:

  • I want to search for a trigger of t:⌘⌃d
  • As soon as I type the "d" it tries to autocomplete "d:", even though that is not valid at that point since I have NOT typed a space.
  • If I press RETURN at that point, it uses the bogus autocomplete
  • I have to press ESC to cancel the autocomplete.
  • This is contrary to most autocomplete systems I have used, which require some keystroke to first accept a proposed autocompletion, usually a TAB, or in Script Editor, F5.

Demo of Autocomplete in Global Find/Search Box

This is even more annoying because I have turn OFF autocomplete with the hidden pref.

Me too, the first thing I do after installing/upgrading KM is disabling the "autocomplete". I think since it exists it is doing very weird things, like inserting a "%" non-regarding that there already is one, and more fancy stuff. The result is almost always a completely messed up variable/token — and me crying out loud "WT*!"

I have a deep respect for people who know how to handle "autocomplete" :wink:

2 Likes