Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

A fix for Illustrator CS' 'Save as PDF' script Apps
For some unknown reason, Adobe Illustrator CS includes a really handy script menu, with a really handy script -- Save Open Documents as PDF. Except for the fact that this script doesn't work. My assumption would be (based on its name) that it is to take every document open in AI and save a version of that document as a PDF, without the hassle of going into each open doc and clicking "Save as...", selecting PDF, clicking all the requisite buttons, closing the doc, going to the next one... etc.

What this supposedly useful script actually does is similar, with the exception that it only saves the top-most window's document as a PDF, leaving the others untouched. This is useless. I've amended the included script to fix the errors involved (they loop on the number of documents in the original script, but only save window 0 and its name.. so if you have nine windows open, the script will save the top-most document nine times ... neat.)

My included script turns off the "Preserve Illustartor Editing Capability," because this option makes PDFs that are much larger than they should be and is almost useless, as you still have to have the AI file to edit. If you want this to be turned back on, there's a line that says preserve editability:false; just change that to true.
-- Get a location for the exported files
set targetFolder to choose folder with prompt ¬
"Location for exported files"
set targetPath to targetFolder as string

tell application "Illustrator CS"
  -- Turn off user interaction so dialogs don't
  -- cause the script to get stuck
  set user interaction level to never interact
  
  --  Count the open documents
  set documentCount to count documents
  display dialog documentCount as string
  --  Export each open document
  repeat with i from 1 to documentCount
    
    --  Get the document's name to use for creating
    -- a file path to save to
    set documentName to name of document i
    
    --  Perform the save
    save document i in file (targetPath & documentName) as pdf ¬
    with options {class:PDF save options, preserve editability:false}
  end repeat
end tell
[robg adds: I don't have Illustrator, so I can't test this one...]
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[19,327 views]  

A fix for Illustrator CS' 'Save as PDF' script | 7 comments | Create New Account
Click here to return to the 'A fix for Illustrator CS' 'Save as PDF' script' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A fix for Illustrator CS' 'Save as PDF' script
Authored by: Lunkus on Apr 07, '04 12:10:29PM

Adobe makes the same error in the script "Export Open Documents As Flash" that is, it does not change the file name in the save file repeat loop but merely saves the first document repeatedly. As in the "Save as PDF" script, change the occurences of "document 1" to "document i" and it should work as expected.



[ Reply to This | # ]
A fix for Illustrator CS' 'Save as PDF' script
Authored by: Lapo on Apr 07, '04 05:24:17PM

In Photoshop CS, there is an automatic process to compile opened images into a unique PDF file. Each image becomes a page in the final PDF presentation.

This behaviour is more interesting, and I guess this must be the idea behind "Save open documents as PDF" in Illustrator...



[ Reply to This | # ]
A fix for Illustrator CS' 'Save as PDF' script
Authored by: alternatekev on Apr 08, '04 12:21:15PM

Well, actually, I end up using Combine PDFs (a RealBASIC application) to combine the resultant PDFs into one. I'd love to redistribute this script with GhostScript of some other PDF-making support so that you can combine the PDFs without an extra end-user step, but I seem to be a little too busy these days to write all the AppleScript/Shell script combinations I've thought of lately.



[ Reply to This | # ]
picky
Authored by: JayBee on Apr 08, '04 08:46:04AM

by the way, it's CS's, not CS'. The possessive s is only dropped after a pluralising s, so for example:

The busses' wheels were all flat, causing a major headache for Ross's wife, the bus company manager...

I'll stop being a pedant now...



[ Reply to This | # ]
picky
Authored by: imageworx on Apr 08, '04 10:25:21AM

Funny. Let me contribute.

<WARNING- Severe RANT below!!!>













Actually, CS stands for " (censored) Sucker". Its the term Adobe secretly applies for those that continually support their products by spending hundreds of dollars each year for an upgrade (that they think they, the CS, need). This upgrade merely changes what you've read in dozens of support books you've invested in as Adobe would rather support some author that can conveniently explain what that new feature really does, than provide useful documentation.
(ie. count the number of books released for each product)

Unfortunately, Adobe lacks the insight to recognize that it can't teach you anything about design.

Finally, Adobe has yet to rewrite its code to FULLY take advantage of 64bit processing. I expect the Linux versions to get better support than the Mac OS X patched ones (aka plugin for Photoshop).

Ooops. Sorry for my rant. One of those mornings...

---
To BeOS or Not to BeOS



[ Reply to This | # ]
A fix for Illustrator CS 'Save as PDF' script
Authored by: Dustcloud on Aug 04, '04 10:00:31AM

Is there any way to make the pdf script also outline the text?



[ Reply to This | # ]
A fix for Illustrator CS' 'Save as PDF' script
Authored by: Spartacus on Apr 19, '06 03:54:39AM

Has anybody managed to make Illustrator CS honour the PDF preset option? When I use it, the options have nothing to do with what's in my preset (e.g. it turns view pdf on and embed ICC off).



[ Reply to This | # ]