DTP


 
Lively discussions on the graphic arts and publishing — in print or on the web


Go Back   Desktop Publishing Forum > General Discussions > Print Production & Automation

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 02-03-2005, 06:10 PM   #1
Dave Saunders
Member
 
Dave Saunders's Avatar
 
Join Date: Jan 2005
Posts: 103
Default IDCS Personalized Documents

I'm acting/directing a play at the church and I needed to print out some personalized calendars, so I banged out this quick script to personalize the calendar and print out a copy for each person:

Code:
myDoc = app.activeDocument;
myStyle = myDoc.characterStyles.item("Person");
myPreset = app.printerPresets.item("LWProWide");
myFolk = ["Dave","Denise","Jeff","Shannon", "Jerry", "Eric", "Mel"];
for (i=0; myFolk.length>i; i++) {
 app.findPreferences = null;
 app.changePreferences = null;
 myDoc.search("",false,false,myFolk[i],{appliedCharacterStyle:myStyle});
 myDoc.print(false,myPreset);
}
I'm posting this partly to test the code tags (they work!). But the script is fairly easy to follow, I think. First, I set myDoc to reference the active document. Then, I setup a reference to the character style named "Person" -- if you try this script on a document that doesn't have such a style, it will give an error at this point.

Similarly, I set up a reference to the printer preset I'm going to use with the print command. Again, if you don't have a preset with this name, this script will die here.

Obviously, you can change the names in the script to match your character style and print preset.

myFolk is an array of the names of the people for whom I'm creating the document.

Then the loop uses Find/Change to replace each instance of text in the Person character style to be the each name in turn, printing a copy before moving on to the next person. In my case, I had a three page document with the name on each page.

This is a JavaScript. To use it, copy and paste it to a plain text file with a name like PersonalizedPrint.js in the Scripts folder of the Presets folder of your InDesign CS application folder.

Dave
Dave Saunders is offline   Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Acrobat 7 and Word documents Michael Rowley Print Production & Automation 0 06-19-2005 01:43 PM
IDCS PageMaker edition terrie Print Design 24 03-31-2005 01:20 PM
Epson 1280, IDCS (Win) michelen Print Production & Automation 16 03-23-2005 03:53 PM
ID CS refuses to import QX5&6 documents ElyseC Print Design 30 02-19-2005 02:46 PM
IDCS and Info palette terrie Print Design 5 01-27-2005 03:36 PM


All times are GMT -8. The time now is 12:13 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Contents copyright 2004–2014 Desktop Publishing Forum and its members.