Advertisement


Export from Illustrator to JSON


Question

I use Illustrator to export coordinates (x, y, width and height) of rectangles to JSON. I use JSON to import the coordinates into my web app and repaint them. I use the free Illustrator extension 'Drawnscript' for this task.

Problem: When I export the coordinates of rectangles there are only x, y, width and height in the JSON. Illustrator makes it possible to give an rectangle a name. I am missing the 'name' of the rectangle in JSON.

Question: How can I pass the name from an rectangle to JSON additional to the coordinates? Are there any better exporting tools than Drawnscript?

2018/05/21
1
0
5/21/2018 3:22:00 PM

I think I understand your problem, but I don't get why you want to use JSON? Could you be more specific on the usage of a further JSON file containing rect values? Have you consider using SVG export? Cause in SVG you can add your own parameter directly from Illustrator such as Layers name, etc.. and use it back through HTML or CSS.

By the way, I just found this on Github, it looks like you can export from PS and Illu into json, and I can see a "name" tag in the export example. https://github.com/bronzehedwick/Adobe-Export-Scripts

2015/10/27
1
10/27/2015 8:11:00 AM