3 Replies Latest reply on Apr 27, 2012 6:51 AM by dserodio

    How to parse Javascript Object Notation in Extendscript?


      I noticed in Dr. Brown's Image Processor the following code:


      dialogResource =  "dialog { text: 'Image Processor', bounds:[100, 100, 480, 540], "


      which is basically assigning object notation to the dialogResource variable.  Then later in the script you see:


      mainDialog = new Window( this.dialogResource );


      Which means Window() takes the object notation and creates a window object using it.  This also means the object notation is being parsed.


      There's another post that allows you to use the Socket() to pull data right off a website (like a web service), so I am really interested in downloading JSON and turning it into local objects.


      Any ideas on how to turn JSON into valid objects in ExtendScript?