🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #14962

(AS, CS) Relating page references to index subtopics

#14962
From: Cris_Lawrence
Date: Wed, 07 Jan 2004 16:16
14 lines
2302 bytes
I am trying to automate index generation for a catalog using Applescript. The index topic and subtopic are extracted from a hidden layer located with each catalog product. Once I parse the content of this layer, I have a list of no more than two items containing the topic and the subtopic (if any). I have no problem generating the topics and subtopics in my script but I can't seem to associate the page references with the subtopics. Regardless of what I have tried, my page references associate with the topics. A relevant script snippet follows:

set myEntryComponents to my parseIndexEntryComponents(contents of myEntry)
set myTopic to make new topic with properties {name:contents of item 1 of myEntryComponents}
tell myTopic
	if (count of myEntryComponents) > 1 then
		set mySubTopic to make new subtopic with properties {name:contents of item 2 of myEntryComponents}
		set myPageReference to make new page reference with properties {parent:mySubTopic, page reference type:current page, parent story:myParentStory, story offset:1}
	else
		set myPageReference to make new page reference with properties {page reference type:current page, parent story:myParentStory, story offset:1}
	end if
end tell

the myEntryComponents variable holds my topic as item 1 and my subtopic (if present) as item 2. I don't see how to relate the page reference to the subtopic, particularly since the subtopic contains no elements. Upon the suggestion of a colleague, I tried assigning the page reference object for the subtopic the parent "mySubTopic" but that modification has no effect on the outcome. Can anyone help me out with this problem? Any ideas would be very welcome indeed. - Cris
Technical Details
Message-ID: <2ccf3c88.-1@webx.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!webx

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,ee2b3c498d942059,start
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2004-01-07 08:37:50 PST
From: Cris_Lawrence@adobeforums.com
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!webx
Newsgroups: adobe.scripting.indesign
Subject: (AS, CS) Relating page references to index subtopics
Message-ID: <2ccf3c88.-1@webx.la2eafNXanI>
Date: Wed, 7 Jan 2004 08:16:46 -0800
Lines: 33
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit