MACRO: Plain Text to Unicode Variants, v1.0


PURPOSE

When using rich text it is obviously easy to emphasize words using bold, italics, etc. There are times when using plain text, one wants to similarly emphasize words or phrases. This can be done by converting the ASCII characters to unicode characters. This conversion can be useful in the context of Keyboard Maestro as depicted in the EXAMPLES section below.


EXAMPLES

1. Dialogs Rendered Using the Prompt For User Input Action

( expand / collapse )


2. List Rendered Using the Prompt With List Action

( expand / collapse )


3. Action Names

( expand / collapse )


DESCRIPTION

This macro is used to convert a line of text to:

  1. ๐—Œ๐–บ๐—‡๐—Œ ๐—Œ๐–พ๐—‹๐—‚๐–ฟ
  2. ๐˜€๐—ฎ๐—ป๐˜€ ๐˜€๐—ฒ๐—ฟ๐—ถ๐—ณ ๐—ฏ๐—ผ๐—น๐—ฑ
  3. ๐˜ด๐˜ข๐˜ฏ๐˜ด ๐˜ด๐˜ฆ๐˜ณ๐˜ช๐˜ง ๐˜ช๐˜ต๐˜ข๐˜ญ๐˜ช๐˜ค
  4. ๐™จ๐™–๐™ฃ๐™จ ๐™จ๐™š๐™ง๐™ž๐™› ๐™—๐™ค๐™ก๐™™ ๐™ž๐™ฉ๐™–๐™ก๐™ž๐™˜
  5. ๐Ÿ…๐Ÿ…”๐Ÿ…–๐Ÿ…๐Ÿ…ฃ๐Ÿ…˜๐Ÿ…ฅ๐Ÿ…” ๐Ÿ…’๐Ÿ…˜๐Ÿ…ก๐Ÿ…’๐Ÿ…›๐Ÿ…”๐Ÿ…“
  6. ๐Ÿ…ฝ๐Ÿ…ด๐Ÿ…ถ๐Ÿ…ฐ๐Ÿ†ƒ๐Ÿ…ธ๐Ÿ†…๐Ÿ…ด ๐Ÿ†‚๐Ÿ†€๐Ÿ†„๐Ÿ…ฐ๐Ÿ†๐Ÿ…ด๐Ÿ…ณ
  7. โ’ธโ’พโ“‡โ’ธโ“โ’บโ’น โ“โ’ถโ“‰โ’พโ“ƒ
  8. ๐Ÿ…‚๐Ÿ…€๐Ÿ…„๐Ÿ„ฐ๐Ÿ…๐Ÿ„ด๐Ÿ„ณ ๐Ÿ„ป๐Ÿ„ฐ๐Ÿ…ƒ๐Ÿ„ธ๐Ÿ„ฝ

When the macro is triggered, a dialog appears that presents an option to convert a manually entered text line or the first text line in the System Clipboard.

The specified line is converted to the eight unicode variants and displayed using a Prompt With List. The selected variant is then written to the System Clipboard.

TESTED WITH

โ€ข Keyboard Maestro 11.0.3
โ€ข Sonoma 14.5 (23F79)/MacBookPro18,2
โ€ข Sonoma 14.5 (23F79)/VariableMacBookPro16,1
โ€ข Mojave 10.14.16/Macmini6,2
โ€ข High Sierra 10.13.6/iMac11,1445

VERSION HISTORY

1.0 initial version


Download: Plain Text to Unicode Variants.kmmacros (42 KB)

Macro-Image


Macro-Notes
  • Macros are always disabled when imported into the Keyboard Maestro Editor.
    • The user must ensure the macro is enabled.
    • The user must also ensure the macro's parent macro-group is enabled.

System Information
  • macOS 14.5 (23F79)
  • Keyboard Maestro v11.0.3

7 Likes

Forgive me my ignorance, but what would be the use case for this macro?

The key phrase is "plain text". One use would be if you were using a plain text editorโ€”that is, an editor is suitable for coding, rather than, say, composing a letter in formatted text, for which you would probably use a WYSIWYG editor such as Pages or Word.

This is plain text so I cannot use italics.

Oh, but if I use @_jims' macro, I ๐˜ค๐˜ข๐˜ฏ! And it provides โ“„โ“‰โ’ฝโ’บโ“‡ possibilities too.

The macro swaps in Unicode alternatives to give the required effect. For instance the italicised "๐˜ค" in "๐˜ค๐˜ข๐˜ฏ" is really "U+1D624 Mathematical Sans-Serif Italic Small C".

2 Likes

That's nice! Thanks for the explanation. On other candidate would possibly be strike through. And maybe underline.

2 Likes

It's also very useful in Keyboard Maestro itself, so you can add some highlighting and callouts to text-only fields such as Prompt for User Input.

Edit:

Do not use this text in variable names, though, if you ever think you'll need them in a shell script command; most shells do not like unicode characters in variable names.

-rob.

1 Like

(That is, Unicode codepoints beyond the first 128. # 0 โ€“ 127 are the same as in ASCII).

2 Likes

Hi, @ALYB. In response to your question, I updated the OP with some examples.

2 Likes