Copy link to clipboard
Copied
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?
Extendscript is just Adobe's flavor of javascript so you could just eval the json string. Or you could use one of the json parsers like http://www.json.org/json2.js
Copy link to clipboard
Copied
Extendscript is just Adobe's flavor of javascript so you could just eval the json string. Or you could use one of the json parsers like http://www.json.org/json2.js
Copy link to clipboard
Copied
I've been using this parser (for generating JSON, not parsing), but Photoshop is incredibly unstable when running my scripts and I suspect json2.js is the culprit. Does anyone have experiencing with json2.js in Photoshop?
Copy link to clipboard
Copied
One note: ScriptUI resource strings are not quite json strings.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more