After Reading the Relevant KBM Wiki Page I'm Still Not Clear on What a Token Is

How that? KM’s “variable” and “token” terminology you mean?

1 Like

Thanks, I will come back to you if I get any further with this on KM: I am not sure if I need to, since to date I have been able to just get macros using variables from other folk, I have an useful renaming one for example. I have no idea how it works though, I tried to work through it. I need to do some work myself on trying to undertand it.

I actually think the range and meaning of the terminology has drifted from its origins in math and logic to the usage in computer languages. Which is fine by the way and how it goes, that is interesting to me independently of IT by the way: I get a lot of interesting material on this site. In fact the use of another term for variables that don't change would, in my view then, be very welcome actually to avoid confusion.
I don't like to overstay my welcome though and take up too much time. I really appreciate how generous, you and many others are in that way here. I hope you don't mind my kind of approach? If not I will continue to engage with you if that is ok.

Yes. I am just entertaining an idea. Since I don't really understand it I don't feel I can take a strong position on terminology. I also see that meaning has drifted from its origins and that is how it always is by the way; so I don't take that as a criticism as such, just something to be aware of. Sometimes, in English notoriously for some reason, words often drift, in language generally, into their opposites, sometimes both meanings are retained. "Literally" being a recent one, 'cleave' and 'bolt' are others. I see no reason why 'variable' might not, in some contexts, come to mean 'constant.

Not an expert here, but I think this is plausible.

What is the exact “thing” you don’t grasp with KM variables? Sorry for the stupid question, but maybe this concrete piece of info could be helpful. If you can nail it down. (As said, I’m clueless of maths variables.)

1 Like

2 posts were split to a new topic: TIP: Understanding KM Tokens

@Tom and @tudor_eynon, the subject of KM "Variables" has already been discussed at length here:

If either of you, or anyone, really feel the need to discuss further, then create a new topic on "KM Variables" by clicking on the link icon of that post.

This thread is about Tokens. Let's keep on topic, please.


Technically you are right (except the mentioned tokens like %Return%, but this doesn’t matter). I just did not want to introduce that term here, because I feared it will lead to more confusion.

As said my answer was tailored to @ronald, and I had the impression he was familiar with the concept of variables. That’s why I started there. (See the OP.)

But, as said, technically you are right, most of them work as functions, and the value can change at any time, which I mentioned as serious caveat here if one is using the the token throughout the macro.

I would add the explanation as function to the wiki, it is certainly useful and will help people understand.

Since tokens and variables get sometimes confused (see the OP!), and they can be used in a similar way under certain conditions, I would opt to not split this thread based on whether a post is more about variables or more about tokens.

The thread started about the differentiation of variables and tokens.

1 Like

That's not how I read it:

That's just background.

That is the question/issue. Did NOT ask about difference between "variables" and "tokens".


I disagree. Trying to show how "Tokens" are like "Variables" only adds confusion to the issue, IMO.

It seems like we now have a clear (to all) definition of "Tokens". Let's not add any confusion. Of course, if anyone still is confused about KM "Tokens", please speak up.


No, Jim, it’s all fine.

1 Like

Fine: I will say that our wiki saying "Tokens in Keyboard Maestro represent placeholders for information about a specific object.", encourages this confusion though? This is exactly how people shorthand their definition of 'variable' very often; as a 'placeholder' or some cognate. I did read the question as @Tom did, though not directly asking for an amplification of the difference as, at least, implying it in some way.

@tudor_eynon, I agree that used of the term "placeholders" is unclear and misleading.

I will revise the KM Wiki in the next day or so, and post update here for everyone's review/comment.

1 Like

The Wiki’s definition explains it from the point of view of a variable (“placeholder”), as I did in this thread, tailored to @ronald.

I don’t think the WiFi definition is necessarily bad, even if it’s “incorrect”. Many people perceive the tokens as a kind of weird variable (me too at the beginning, IIRC).
Reword it, if you want, so that it is clear that the explanation is a didactic approximation.

But I would leave the “variable” concept in for explanation, and then add a more in-depth explanation that explains that tokens basically more work like functions. (For the people familiar with the functions concept.)

Keep in mind, many people new to KM have no concept at all of functions and barely have a concept of variables. But the “variable” concept is way easier to grasp than the “function” one. IMO.

That’s why I’m proposing this. No offense meant.

Tom, we will have to agree to disagree on this.

Most non-programmer types have NO concept of what a "variable" is or how you would use it.
However, I would submit that since Excel is one of the World's most popular apps, more users are likely to have some exposure to "functions" than "variables".

1 Like

Well, I don’t see that many Mac users are also macro writers in Excel (but I agree that in Excel the “function” term is more predominant than the “variable”, since the variable is mostly an already existing cell),

And I also agree, quoting you “Most non-programmer types have NO concept of what a "variable" is or how you would use it.”

Though: Most non-programmer types have even less concept (except the Excel-ones, though I doubt they are going to translate the Excel “function” term into a generic one without comprehension problems) of a function.

So, I think it would be beneficial to have both definition approaches in the Wiki.

But I already said that :slight_smile:

And I won’t say anything more on this.

Do what you consider best.
Thanks for reading (and maybe considering) my point of view.

And yes, I also appreciate that you are open for discussion on the Wiki entries. Thanks for that.

Using functions in Excel does NOT require writing Excel macro. Almost every Excel user does this when entering a formula in Excel, as simple as =SUM(A1:A10).

Excel provides lots of exposure to "functions":


OK, against what I promised you convinced me to write another comment:

Your example (and the GUIness of the example) underlines what I meant when I said that even if an Excel user (macro writer or not) that is using functions will not necessarily have a concept of functions. At least not one that would be transferable to KM or another language.

My original wording:

though I doubt they are going to translate the Excel “function” term into a generic one without comprehension problems)

But I don’t really think this is important.

Let’s say, there are some KM newcomers that have a concept of “variable” and not of “function”, and other ones that have a concept of “function” (from Excel maybe) but no clue of “variable”.

So why not be helpful to both?

Anyway, an interesting fragment on didactic concepts and on what one expects from others we don’t know :wink:


With “fragment” I refer to the last part of this thread, not to your last post.

1 Like

Tom, you are beating a dead horse.