Skip to main content
Participant
January 31, 2026
Answered

Bug report - AppleScript Export command ignores artboard clipping option

  • January 31, 2026
  • 1 reply
  • 45 views

The AppleScript command Export ignores the Export Option ‘artboard clipping’ for PNG8, PNG24 and JPEG files, which were the only file types I tried. In other words, when the option is set to true, the exported image has not been trimmed to the artboard. 

I happened to notice that with JPEG files, when the option blur:0 is included, the ‘artboard trimming’ option is effective. Other options with JPEG files did not that that effect. I haven’t found any options which have the same effect on PNG8 and PNG24 files.

MacBook Pro 16” M2 Max

macOS 26.2

Illustrator 30.1

    Correct answer David 14.1

    The work-around I am using is to use JavaScript for the export:

    tell application "Adobe Illustrator" to tell current document
    set theJavaScript to "var exportOptions = new ExportOptionsPNG24(); exportOptions.artBoardClipping = true; app.activeDocument.exportFile(new File(\"" & /path/to/file & "\"), ExportType.PNG24, exportOptions)"
    do javascript theJavaScript
    end tell

    I hope this is useful.

    1 reply

    Participant
    February 1, 2026

    Been fighting same issue today. Thanks for posting this David.

    David 14.1AuthorCorrect answer
    Participant
    February 1, 2026

    The work-around I am using is to use JavaScript for the export:

    tell application "Adobe Illustrator" to tell current document
    set theJavaScript to "var exportOptions = new ExportOptionsPNG24(); exportOptions.artBoardClipping = true; app.activeDocument.exportFile(new File(\"" & /path/to/file & "\"), ExportType.PNG24, exportOptions)"
    do javascript theJavaScript
    end tell

    I hope this is useful.

    Participant
    February 1, 2026

    Brilliant. Thank you David. You made my day. Take care.