Help with Setting a Dictionary with JSON string please

I think I must be making a basic mistake with setting dictionary to JSON: Here is a screen shot.

The set dictionary works fine. The set dictionary to JSON fails (abort macro is off to get the window display to work). I have tried each of the Process Text (Normal, Tokens, Nothing) and I tried formatting the string both with (shown) and without "pretty" formatting , ie no returns.

I've read all the other messages related but nothing I've found helps ... can any one point me to what I'm doing wrong please

Could you post the macro itself ?

( the action is hidden there by the error message )

z_Dictionary Tester.kmmacros (4.6 KB)

Looks like a "smartquotes" issue

Something on your system has "auto-corrected" JSON-valid plain double quotes to a JSON-invalid "smart" character at the start of "Canada 1825"


Fix it to this:

 "Canada 1825" : "20 Jun 1825",
 "Canada 1831" : "1 Jun 1831" 

and I think you will be fine.

If there's any reason to anticipate repetition of this glitch, you could insert a preliminary Filter action to remove any accidental "smart" quote characters:

Thanks very much... you have eagle eyes!. Yes this fixed the problem ... and I can repeatedly reproduce it even starting macro from scratch... so the filter is the trick.

1 Like