Description:
Facilitates easier creation and updating of dictionaries from a formatted string, utilising a simple and flexible syntax that will hopefully feel comfortable to anyone familiar with one of the common declarative scripting languages from which this borrows.
Syntax overview
Key-value pairs declared one per line, contained within brackets or braces following the name of the dictionary that is to be created or modified. See the image above for an example. An alternative form is:
${dictionary-name} : [
${key}=${value}
${key}=${value}
.
.
.
]
Guidance notes:
Either square brackets [...]
or curly braces {...}
may be used to delimit the start and end of the dictionary contents within which {key, value}
pairs are declared and needn't be a matching pair. The opening delimiter is preceded by the name of the dictionary; a colon may optionally follow the name of the dictionary but can be omitted. {key, value}
pairs are declared on individual lines, using either a colon :
, a bar |
, or an equals sign =
as the delimiting character. Keys, values and the dictionary name can contain spaces, but leading and trailing whitespace for all identifiers and delimiting punctuation is ignored, as are blank lines. This macro does not currently cater for values that contain newline characters.
Create Dictionary.kmmacros (43.5 KB)