With a JSON dictionary string encoding the ISO 3166-1 two letter codes that you need, paired with the full country name versions that you want, you can use the Keyboard Maestro %JSONValue% token to retrieve the match that you want.
Thank you @ComplexPoint. That looks good. But I fear I didn't make myself clear enough.
I have a sheet that only contains the abbreviation. My goal is to copy this to the clipboard and then set a variable to the full country name depending on this. I want to use this Variable in the rest of the macro.
So I need a kind of "if, then, else" condition that says: If the clipboard contains "DE" set the Variable to "Germany". Or is this already possible and I just don't see it?
I was looking for a solution other than cascading many “If, Then, Else” statements. Does this makes sense?
It's already there, once you have your codes and country names in the JSON format @ComplexPoint shows above. You then retrieve the name using the %JSONValue% token.
The %JSONValue%Local_json.DE% token evaluates to
"the value of Local_json's Dictionary item whose key is DE"
...and, given the above Dictionary, would be replaced at execution with "Germany". %JSONValue%Local_json.BG% would be replaced with "Bulgaria", etc.
( hash table vs linear search is the underlying pattern there – in the contrast between keyed dictionaries and line-scanning. The advantage, if any, is trivial with short lists, but grows quite rapidly with scale )