🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #130

Re: Section Marker, Headers

#130
From: Ralf_Funke
Date: Thu, 02 Apr 2009 15:48
25 lines
1541 bytes
This was surprisingly difficult. (And I could not make it work in in JS :-() Assuming every chapter starts on a new page with a paragraph style called "Chapter" you can do something like this:

tell application "Adobe InDesign CS3"
  tell document 1
    try
      delete every section
    end try
    repeat with i from 1 to count pages
      if name of applied paragraph style of text 1 of text frame 1 of page i = "Chapter" then
        set chaptertitle to contents of paragraph 1 of text 1 of text frame 1 of page i
       
        set newsec to make new section
        if i = 1 then
          set continue numbering of newsec to false
        else
          set continue numbering of newsec to true
        end if
        set page start of newsec to page i
        set marker of newsec to chaptertitle
      end if
    end repeat
  end tell
end tell

Ralf
Technical Details
Message-ID: <59b87a86.3@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!newshub.sdsu.edu!webcrossing
References: <59b87a86.-1@webcrossing.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,ea9d027eb76e50df
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: Ralf_Funke@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: Re: Section Marker, Headers
Message-ID: <59b87a86.3@webcrossing.la2eafNXanI>
Date: Thu, 2 Apr 2009 08:48:42 -0700
References: <59b87a86.-1@webcrossing.la2eafNXanI>
Lines: 34
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit