This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
manual:Dictionaries [2017/09/04 01:54] peternlewis [See Also] |
manual:Dictionaries [2017/09/04 02:04] peternlewis |
||
---|---|---|---|
Line 20: | Line 20: | ||
{{:token:dictionary-example.png?nolink&568|}} | {{:token:dictionary-example.png?nolink&568|}} | ||
+ | |||
+ | You can list the dictionaries with the [[collection:Dictionaries|Dictionaries]] collection, and you can list all the keys within a dictionary with the [[collection:Dictionary_Keys|Dictionary Keys]] collection. | ||
+ | |||
+ | ===== AppleScript ===== | ||
+ | |||
+ | You can read and write dictionary values from AppleScript. | ||
+ | |||
+ | ```applescript | ||
+ | tell application "Keyboard Maestro Engine" | ||
+ | name of dictionaries | ||
+ | end tell | ||
+ | ``` | ||
+ | |||
+ | ```applescript | ||
+ | tell application "Keyboard Maestro Engine" | ||
+ | dictionary keys of dictionary "First Names" | ||
+ | end tell | ||
+ | ``` | ||
+ | |||
+ | ```applescript | ||
+ | tell application "Keyboard Maestro Engine" | ||
+ | set value of dictionary key "P" of dictionary "First Names" to "Fred" | ||
+ | end tell | ||
+ | ``` | ||
===== See Also ===== | ===== See Also ===== | ||
See also the [[action:Set_Dictionary_Value|Set Dictionary Value]] action, the [[token:Dictionary|%Dictionary%]] token and the [[collection:Dictionaries|Dictionaries]] and [[collection:Dictionary_Keys|Dictionary Keys]] collections. | See also the [[action:Set_Dictionary_Value|Set Dictionary Value]] action, the [[token:Dictionary|%Dictionary%]] token and the [[collection:Dictionaries|Dictionaries]] and [[collection:Dictionary_Keys|Dictionary Keys]] collections. |