Illustrator Script

My company customizes 20-page PDF proposals in Illustrator for hundreds of clients. We start by opening the individual PDF files, replacing certain words, then saving the files - last we combine the 20 PDF files into one document.

I’m looking for a scipt that that allows me to Open a PDF file in Illustrator, “Find and Replace” text, then Save the File.

This would be my first script…Any ideas?

here is a thread on this subject:
http://bbs.applescript.net/viewtopic.php?id=16249

The solution in the referenced discussion is a good description of GUI scripting using scripting events. However it is a bit of a convaluted way to search and replace using AppleScript when you can use object references for the text frames to do the same thing. The biggest problem that I see in filling doing the search and replace that jklein1 wants to do is in the quality of the parsing of the PDF’s when opened by Illustrator. From what I have seen is that sometimes you have words that are split by character by character and you more likely to get split lines than whole sentances or paragraphs.

From what I see you need the script to do the following:

  1. Get the page count of the PDF
  2. Open the PDF, page by page.
  3. Search and replace
  4. Save the individual pages (as PDF?).
    —Repeat steps 2-4 untill all pages are completed
  5. Switch to Acrobat and combine the individual pages into one document.

Also to consider is what the workflow would be. You could do a drag and drop, a folder action, or choose individual folders or files to process.

Step 1 will also depends on what OS you are using, (see http://bbs.applescript.net/viewtopic.php?id=16274), to determine the number of pages in the PDF sot that you can process each page.

Would be how sensative you searches and replace is. Do you need case sensativity? Only replace whole words? Limit the search to specific fonts or colors?

Then, since this is a script for a professional workflow, you are it would be best have to have error checking and reporting in place so that you know when, what, and where an error occurrs.