Per the KM Wiki:
action:Prompt for User Input [Keyboard Maestro Wiki]
Use a dash to create a separator
If a popup menu item is a dash (-), then a separator is displayed. For example, “Good|Better|Best|-|Terrible
”
But I need the dash character to be valid choice.
How do I do this?
I've tried the traditional escape of \-
but that did NOT help.
Here's my default value:
%Variable%DND_DD__Header_Char%|NONE|~|-|–|=
johseb
May 16, 2016, 11:06pm
2
Hi,
did you try using other dashes (em dash, en dash, horizontal bar, figure dash)?
As I can see you need two dashes, a short one (hyphen) and a long one. You could try using other dashes and then search and replace your variable to get the ones you want into it.
This screenshot was taken substituting the hyphen in your list with a figure dash (Unicode point U+2012).
iNik
May 17, 2016, 4:10am
3
If you put a space before the dash, it will show up. Then just trim whitespace at the front/back of your variable's value and you're good to go.
Good idea, except put the SPACE after the dash char.
That way, the user can select the dash by typing a dash.
1 Like
@peternlewis :
May I request that you honor the escape character with this notation, so that:
\-
Would appear and be used as:
-
THanks.
peternlewis:
Use -__-.
Peter,
Thanks for pointing out that solution.
However, it stll has one limitation. When the dash is selected, and then used in a variable in a subsequent execution of the macro, it will NOT show up as the default value.
So, while this works in the display of choices:
%Variable%DND_DD__Header_Char%|NONE|DASH|-__-|~|–|=|#|•|+
the next time I run the macro it shows as this:
It seems to me that the best solution would be to use a special string to indicate the dividing line in the popup menu, perhaps something like \-\
In that case you just need to use __ for all of them so that the first entry matches properly.
%Variable%DND_DD__Header_Char%__%Variable%DND_DD__Header_Char%|NONE__NONE|DASH__DASH|-__-|~__~|–__–|=__=|#__#|•__•|+__+
Wow! That is a very laborious solution. It would be way to difficult, and error prone, for users of the macro to maintain and change.
I think I'll just stick to my initial work-around of using "DASH".
Personally, I’d just use a unicode character that looks like a dash and search & replace the variable before and have the prompt.
But in any event, you have lots of solutions now!
Again, too much work and confusion.
The user would expect to type a standard dash to select the alternate unicode character, and it wouldn't work. More headaches.
I'll go back to my original suggestion: Instead of hijacking a normal character for a divide line, use something special, like \-\
It might break a few existing macros, but probably not many, and not in a critical way.