Check if substring equal to a Unicode Character

I have a macro to indent left or right a wiki list item or heading levels using a keyboard shortcut like <Cmd><Ctrl><Alt><Right/Left> which works by adding or removing ‘#’ from an existing string.

example Markdown:

## Heading 2

* List item1
** List item 2

I am trying to make this more generic by making the macro check if the left most character is a ‘*’ or a ‘#’. if so add or remove that character.

Any suggestions how I can check if a substring is Equal to a Unicode Character (example %23%) ?

A switch case with pasted character worked. :slight_smile:
Seems there is no CHR( ) function for keyboard maestro.

Wished there was an option to pass a variable to a bash script and get the returned result. Then coulda asked ruby/python to do that work.

If you show you're existing macro, I am sure it can be easily extended to work with both # and *.

A substring of what? If Variable Contains or Matches will do that.

Not really, no. You can do that in a bunch of ways with a script though.

That is what the Execute a Shell Script action does.

1 Like