🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #9179

Re: Apply header thorught an entire book file

#9179
From: Dirk_Becker
Date: Sat, 09 Sep 2006 16:01
40 lines
2321 bytes
This is a very simple script. It assumes you have a frame on the first document with the script label "theBookTitle". The contents of this frame are then copied to all documents in the book.
Chapter documents should have a text frame on their first master spread that has the same "theBookTitle" label.

I hope the script makes it through the forum software.

Regarding guides on InDesign scripting, there is a long thread on top of this forum, besides there are several references on the Adobe page
 <http://www.adobe.com/products/indesign/xml_scripting.html>

Dirk



if( app.books.length==0 ) { 
    alert(�no book�); 
    exit(0); 
}

var theBook = app.books[0]; 
var theBookTitle = �no book title found�; 
for( docInx=0; docInx<theBook.bookContents.length; docInx++ ) { 
    var theDoc = app.open(theBook.bookContents[docInx].fullName); 
    if( docInx==0 ) { 
        var theSpread = theDoc.spreads[0]; 
        for( itemInx=0; itemInx<theSpread.textFrames.length; itemInx++ ) { 
            var theItem = theSpread.textFrames[itemInx]; 
            if( theItem.label==�theBookTitle� ) { 
                theBookTitle = theItem.texts[0].contents; 
                break; 
            } 
        } 
    }   
    var theSpread = theDoc.masterSpreads[0]; 
    for( itemInx=0; itemInx<theSpread.textFrames.length; itemInx++ ) { 
        var theItem = theSpread.textFrames[itemInx]; 
        if( theItem.appliedObjectStyle!=null ) 
        if( theItem.label==�theBookTitle� ) { 
            theItem.texts[0].contents = theBookTitle; 
        } 
    } 
} 
Technical Details
Message-ID: <3bc18b42.6@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!newsfeed.kamp.net!newsfeed.kamp.net!news.motzarella.org!news.isoc.lu!webcrossing
References: <3bc18b42.-1@webcrossing.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,2413df2b7c256133
X-Google-Attributes: gidf939a,public
X-Google-Language: ENGLISH,ASCII
From: Dirk_Becker@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!newsfeed.kamp.net!newsfeed.kamp.net!news.motzarella.org!news.isoc.lu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: Re: Apply header thorught an entire book file
Message-ID: <3bc18b42.6@webcrossing.la2eafNXanI>
Date: Sat, 9 Sep 2006 09:01:31 -0700
References: <3bc18b42.-1@webcrossing.la2eafNXanI>
Lines: 45
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit