SVG Export with AppleScript Broken - class:SVG export options not working

New Here ,
Nov 15, 2016

Copy link to clipboard

Copied

Is this a known issue? Even the scripting guide PDFs don't match the AppleScript dictionary for the last few versions of Illustrator. Is this a known bug?

Views

173

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

SVG Export with AppleScript Broken - class:SVG export options not working

New Here ,
Nov 15, 2016

Copy link to clipboard

Copied

Is this a known issue? Even the scripting guide PDFs don't match the AppleScript dictionary for the last few versions of Illustrator. Is this a known bug?

Views

174

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Nov 15, 2016 0
Community Beginner ,
Feb 06, 2020

Copy link to clipboard

Copied

I'm seeing this same issue. Unfortunately at this time I don't know how to get around this failure. I'm not getting outlined font info that is present when using the UI to perform the export.

 

Is this an intentional deprecation?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 06, 2020 0
New Here ,
Jun 19, 2020

Copy link to clipboard

Copied

There is a note buried in the scripting guide about the SVG export options needing to be explicitly created, it's not in the online reference guide, but instead of doing something like this...

 

tell current document

export to outFile as SVG with options {class:SVG export options, coordinate precision:2, save multiple artboards:true, artboard range:"Artboard 1", minify svg:true, set type of SVG:unique svg}

end tell

 

try creating the SVG export options and then pass that to the export method:

set exportOptions to {class:SVG export options, coordinate precision:2, save multiple artboards:true, artboard range:"Artboard 1", minify svg:true, set type of SVG:unique svg}

 

tell current document

export to outFile as SVG with exportOptions

end tell

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 19, 2020 0
Community Beginner ,
Jun 24, 2020

Copy link to clipboard

Copied

Thank you for the suggestion. Although I didn't update my post I did have an attempt at extracting the settings which look like this:

 

set exportOptions2 to {class:SVG export options, coordinate precision:5, font type:outline font, minify svg:true, raster image location:link, responsive svg:true}

tell current document

export to outFile as SVG with options exportOptions2

end tell

 

At export I'm seeing Error: error in user parameter list (paramErr:-50)

 

I did some additional work at implementing embedded js to handle the export, but haven't gotten back to it since the pandemic hit.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 24, 2020 1
5E5B LATEST
New Here ,
Nov 03, 2020

Copy link to clipboard

Copied

Did you ever figure out the embedded js? That is what I am trying now, but I cannot figure out how to write the property for setTypeOfSVG. The property is listed in Illustrator's scripting dictionary in Script Editor (not found in Adobe's scripting reference), but doesnt list the value type.

Screen Shot 2020-11-03 at 9.04.14 PM.png

The syntax works for the applescript counterpart, but as you discovered, the SVG export options class throws an error and doesnt apply the settings without it.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 03, 2020 0
Resources