Description
The association list is one of the most commonly used objects in any programming or scripting language, computing routine but also, applications. The association list (or "alist") is a list made of key-value pairs, and in each key-value pair the key is associated with the value, hence the name.
This shortcut displays the number of times the item repeats. It does that by converting any kind of input to text, splitting the text into words, taking the list of items and creating an association list in JSON format. On processing the items, it shows the result in a dialog window and copies it to Universal Clipboard making it available on every Apple device. "Make Association List" is not a standalone shortcut, it's merely a vessel to carry the data to process. To see the list in action and as an inspiration to take on your own endeavours you may want to download these example shortcuts requiring "Make Association List"; it's versatile enough to accommodate many use cases and scenarios:
"Words Counter", click to download: Words Counter
"Sort Photos By Location", click to download: Sort Photos By Location
Bear in mind, though, the association list's performance is lower with larger chunks of data.
Another small caveat and warning at the same time is that with some types of input data it will produce a non-sensical result such as a list of unique items that are supposed to be constituent parts but not the items themselves. It usually happens when, for example, formatted dates become text objects via the Formate date action as opposed to preserving their type as a standard date object and thus unintentionally are subject to text splitting which normally is meant only for text but not a date. E.g., the date 2021-07-15, 18:30:00 breaks down into {2021, 07, 15, 18, 30, 00}. There's no way to work around this inconsistency unless tailoring this plugin on a case-by-case basis. Still, it will make its best to attempt to circumvent this annoyance.
More about the association list at Association List, Wikipedia
Feedback is welcome.