"Token Text" vs "Token Text Only"

Silly question probably but what is the difference between "Token Text" vs "Token Text Only" in the value inspector? I couldn't find anything on the wiki or on this forum on what the difference is.

image

https://wiki.keyboardmaestro.com/Home_Page?do=search&id=Home_Page&sf=1&q="Token+Text+Only"

1 Like

Great question. The online manual doesn't say. I did some tests of my own and couldn't determine the difference.

Then I went to ChatGPT and it said that "token text only" will not return any text other than the token text. (It claimed that if you use "Today is %LongDate%" it won't return the text "Today is ".) That makes sense, but I tried that and it didn't work.

Perhaps one of the true wizards of this site can explain it, or they can tag the Architect in their reply so that he reads it. (I hate disturbing the Architect when it's usually my own fault.)

This is intriguing! I cannot work out the implication of "only" here either.

I'm not a wizard but I'll happily flag @peternlewis since I'm sure he would like to fill in the gap in the Wiki's coverage, whether or not we are enlightened here in the meantime!

Haha, that's how I feel about you guys. I get replies that blow my mind from you guys and I am in awe at what I am looking at for the results. Thanks @kevinb for tagging the boss.

1 Like

Just trims inadvertent white space, I think.

It isn't trimming white space for me.

From this experiment:

\n breaks the %SystemClipboard% token in both cases (as one might expect) but note that \n is not processed by "Token Text Only".

I take it that the purpose is the same as when being able to choose how tokens are processed under the cogwheel of actions.

Perhaps someone could now come up with a more sensible test. :slight_smile:

i.e. only the Tokens are preprocessed – sequences like "\n" are not rewritten to LF white space.

as in your example:

Screenshot 2025-02-13 at 10.58.47 pm
Screenshot 2025-02-13 at 10.58.34 pm

Yes, exactly. So what would be a more sensible example? I have been experimenting with various tokens but have yet to discover a convincing case of where such processing would be desirable (which is not to say that I doubt that there are such cases).

It seems to me that the challenge could be broken down as follows:

  1. Come up with a good example of ("pre"?)-processing in connection with tokens versus not... when using the settings in the cogwheel of an action.

  2. Show how that would be useful in the Value Inspector window.

I hope that will inspire someone who is more familiar with the subject. :wink:

This is across Keyboard Maestro, not just the Value Inspector. For example:

Processing Text Tokens normally includes both tokens (eg %SystemClipboard%) as well as backslash characters (eg \n). The latter can be ignored by processing Text Tokens Only.

For example, here are the three options:

5 Likes

Yes, so I gathered from revising tokens in the Wiki, which was my clue to guessing the meaning of "Token Text Only". I mentioned that "the purpose is the same as... under the cogwheel of actions", but I am now very curious about where else we this "across Keyboard Maestro"! Were you referring just to the cogwheel in relevant Actions, or are there other appearances..?

I hope you will agree that this topic indicates that the Wiki's entry for the Value Inspector window should state the difference between "Token Text" and "Token Text Only".

1 Like

Interesting I did not know that existed and I am in the cog while often on actions. That Prepend to Variable is nice too. I just used the Prepend to Variable actions but it looks like that is not always needed.

The link below also points to that link so it looks like that is the main page on the Wiki about the value inspector and that it doesn't have it's own dedicated page.

https://wiki.keyboardmaestro.com/manual/Menus?s[]=value%20inspector#Value_Inspector

I think you'll find that "Set...", "Append...", and "Prepend..." are the same action but with different options selected.

2 Likes