🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #14782

[AS] Trying to get page number of items found in search

#14782
From: McKinley_Media
Date: Fri, 16 Jan 2004 18:56
25 lines
1604 bytes
I'm trying to get the page number of each item that was returned from a search. I'm actually trying to get the last item of each page.....

I used "page reference" but I guess that's wrong.

Here's a parred down version of the code I have:

tell application "InDesign CS"
	set myDoc to active document
	set myPstyle to paragraph style "County" of myDoc
	tell myDoc
		set theResult to search with find attributes {applied paragraph style:myPstyle}
	end tell
	set myResultIndex to 1
	repeat with myPage from 1 to (the number of pages in myDoc)
             if page reference of item myResultIndex of theResult = myPage then
			repeat while (page reference of item (myResultIndex + 1) of theResult = myPage)
				myResultIndex = myResultIndex + 1
			end repeat
		 tell page myPage of myDoc
			set myTabFrame to make text frame
			set text of myTabFrame to item myResultIndex of theResult
		 end tell
             end if
        end repeat
end tell
Technical Details
Message-ID: <2ccf6992.-1@webx.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!eusc.inter.net!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,9b6002a7f546799e,start
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2004-01-16 11:07:59 PST
From: McKinley_Media@adobeforums.com
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!webx
Newsgroups: adobe.scripting.indesign
Subject: [AS] Trying to get page number of items found in search
Message-ID: <2ccf6992.-1@webx.la2eafNXanI>
Date: Fri, 16 Jan 2004 10:56:47 -0800
Lines: 29
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit