visit
During the course of , I managed to discover “a command line tool to document and describe keyboard shortcuts in a standardized and properly formatted way” called . It's a Python utility that translates natural-language-formatted keyboard commands “command control q” into symbolized and standardized form: ⌃+⌘+Q
. Though it's not of particular use to me at this point, with my now well-established and , I realized – being a Python thing – that ksc might work with the iOS/iPadOS shell emulator, , and therefore, that a Siri Shortcut for converting plain language input to formatted key commands might be a cinch, and it was!
pip install ksc
)
ksc -ms -p command(Pre-Transformation Text) > Transformed Text.txt
By default, the arguments -ms
and -p
are included, but these are entirely optional. From said docs:
There are several command line options to modify the output. The
-ms
or--modifier-symbols
options output the modifers as unicode symbols:
$ ksc -ms shift command u ⇧⌘U
Apple says you should include a plus sign between symbols, but I think that it looks ugly, so that's not the default. If you want it, add the
-p
or--plus-sign
when using-ms
:
$ ksc -ms -p shift command u ⇧+⌘+U
Creating a text file for each command within a-Shell may not be Best Practices, per se, but it's the simplest method I've found of reliably retrieving text back from the app within Siri Shortcuts. That said, the above command creates a text file containing the formatted output. A Get File
a-Shell action paired with a native action then retrieves the file contents, which is first cleaned up via another Actions action (trimming leading and trailing whitespace) before being copied to the system clipboard.
.