Adding comma to variable?

Looking to see if I can switch from TextExpander to KM. I noticed that I cannot add a common to a variable "variable," However, I need this for my snippets as you can see in the picture. Is there a workaround for this?

I'm not sure that I understand your question/issue, but a KM Variable can definitly contain a comma (",") character.

Perhaps this would help:
"Import TextExpander Group" Macro

Take a look here

You can't use a comma in a Variable name. Why would you want to?

This looks like a typo to me:

Shouldn't it be:
%Variable%future%,

Notice that future, is in red. This means something is wrong:

In Keyboard Maestro, you use a Prompt for User Input action to collect the data you want.

It looks like the first lot would be a single selection, where the second lot you want to select one or more from a list and then have them joined with "," and presumably optionally "and" for the last one. I presume this latter behaviour is a very nice TextExpander behaviour, the sort of thing you get for free in a dedicated text expansion program that you have to build yourself in a more general program like Keyboard Maestro.

So, starting out with the two cases, you want a Prompt For user Input action like this:

which produces a dialog like this:

After which you will need to do the work required to make the sentence you want.

So for the first sentence, if you don't want the numbers to show, just the words, something like:

The second sentence is obviously more tricky.

Start with:

and for each entry:

This is a bit tedious, but is actually very easy, just duplicate the previous entry and change the variable and text.

And then at the end you need to see if there is at least one comma (I'll ignore this case since you might never have a case where there is no selections at all, but if that could happen you'll want to deal with it) and at least two commas so, you want to change the second ,last ", " to ", and ".

and then insert (display) the text:

As you can imagine, this is the sort of thing where a dedicated tool is far easier to use. On the other hand, Keyboard Maestro can do all sorts of other things as part of this process depending on what exactly you want to happen.

1 Like

Thank you very much for your detailed explanation. I have learned that for text expansions of such kind I will be better off with TextExapnder.

2 Likes