MACRO Example: Swift Script returning list of variable names from KME

Have a look at this then: MACRO: Variable Inspector Prompt and Dictionary Editor v3.2