I'm reading tokens from a file and attempting to dereference them. So when reading a file containing %NumberDate%, for example, I want to convert it to 2/20/22. I tried this:
and got this result:
I want to get 2/20/22 for both. Is there some function I can apply to the variable containing the string %NumberDate% to turn it into the actual date, or some other way to do it?
Yes, Dan is correct, there's a KM action called Filter which has an option called "Process Tokens" which lets you evaluate the contents of a token whose name is stored in a variable.
Over the last week I've posted two or three macros in the Macros part of this website using that action. If you need to examine one of my examples, I'll post a link to one in this message in a few minutes.
...
Okay, here's one of my macros which uses that action if you want to see it in action:...
This method can be used to evaluate tokens, variables, dictionaries, or calculations.
I believe that there's also a way in AppleScript to "dereference" variables within AppleScript. So I think that even without this action in KM, there's another way to get this job done, since AppleScript can access KM variables (but probably not tokens or dictionaries. Hmm, that's making me think.)