• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Exporting JPEGs from Illustrator CS6
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exporting JPEGs from Illustrator CS6


  • Subject: Re: Exporting JPEGs from Illustrator CS6
  • From: David Popham <email@hidden>
  • Date: Thu, 27 Mar 2014 09:50:01 -0700 (PDT)

Hi Robert,

I'm not sure why it's behaving that way without investigating further, but you could get it to work by having it close each file in the repeat loop and setting "theDoc" to current document.

tell application "Adobe Illustrator"
set theDocuments to every document
repeat with theDoc in theDocuments

set theDoc to current document

set thePath to (file path of theDoc)
set theAlias to (thePath & ".jpg") as text
set theJPGExportOptions to {class:JPEG export options, antialiasing:false, quality:100, optimization:true}
export theDoc as JPEG to theAlias with options theJPGExportOptions
close theDoc saving no
end repeat
end tell


Also, "file path" includes the file name extension, which means your files will end in ".ai.jpg". Not sure if that's what you want, but you can always parse out the .ai file extension.

Best,
David


On Thursday, March 27, 2014 10:04 AM, Robert Stott <email@hidden> wrote:
Hi all,

This is so basic I'm almost embarrassed to post it, but I'm having problems with a short script to export JPEGs from Illustrator. If for example I had three Illustrator documents open, I'd expect the script below to step through each open document and three JPEGs - one of each document. 

Instead, I get the files I expect but the content of each JPEG is from my frontmost document - so three identical JPEGs.

Any suggestions? Have I found a bug or am I having a dumb day?

Thanks
Rob

tell application "Adobe Illustrator"
set theDocuments to every document
repeat with theDoc in theDocuments
set thePath to (file path of theDoc)
set theAlias to (thePath & ".jpg") as text
set theJPGExportOptions to {class:JPEG export options, antialiasing:false, quality:100, optimization:true}
export theDoc as JPEG to theAlias with options theJPGExportOptions
end repeat
end tell
Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: Archives: http://lists.apple.com/archives/applescript-users This email sent to email@hidden
  • Follow-Ups:
    • Re: Exporting JPEGs from Illustrator CS6
      • From: Alex Zavatone <email@hidden>
References: 
 >Exporting JPEGs from Illustrator CS6 (From: Robert Stott <email@hidden>)

  • Prev by Date: Re: Root User
  • Next by Date: Re: Exporting JPEGs from Illustrator CS6
  • Previous by thread: Exporting JPEGs from Illustrator CS6
  • Next by thread: Re: Exporting JPEGs from Illustrator CS6
  • Index(es):
    • Date
    • Thread