Article View: adobe.scripting.indesign
Article #9488Re: Numbering based on auto page number
From: herrmueller
Date: Tue, 22 Aug 2006 03:12
Date: Tue, 22 Aug 2006 03:12
34 lines
1485 bytes
1485 bytes
//addCouponNums2page.jsx
//Move the textFrames to the masterPage and run the script
//First time through, this will override the master item
//Thus moving it to each page not the master
//Any other time, it changes numbers based on their page number
//Please test on duplicate of your file
doc = app.activeDocument;
pgLn = doc.pages.length;
for(i = pgLn; i > 0; i--){
iPage = doc.pages[i-1];
try{
pn = iPage.textFrames.item("pageName");
pn.contents="Page "+i;
}catch(e){
pn = iPage.appliedMaster.textFrames.item("pageName");
pn.contents="Page "+i;
pn.override(iPage);
}
try{
cn = iPage.textFrames.item("couponNum");
cn.contents="Coupon Number " + (i + 9000);
}catch(e){
cn = iPage.appliedMaster.textFrames.item("couponNum");
cn.contents="Coupon Number " + (i + 9000);
cn.override(iPage);
}
}
Technical Details
Message-ID:
<3bc14d44.9@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!news.glorb.com!news.ecp.fr!news.stben.net!webcrossingReferences:
<3bc14d44.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,f696280db6c146fa X-Google-Attributes: gidf939a,public X-Google-Language: ENGLISH,ASCII-7-bit From: herrmueller <jmiller@halodesignstudios.com> Newsgroups: adobe.scripting.indesign Subject: Re: Numbering based on auto page number Message-ID: <3bc14d44.9@webcrossing.la2eafNXanI> Date: Mon, 21 Aug 2006 20:12:23 -0700 References: <3bc14d44.-1@webcrossing.la2eafNXanI> Lines: 33 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!news.glorb.com!news.ecp.fr!news.stben.net!webcrossing