Article View: adobe.scripting.indesign
Article #20622Re: AS: Creation of an index from a text file
From: Shane Stanley
Date: Sun, 16 Jun 2002 23:46
Date: Sun, 16 Jun 2002 23:46
32 lines
1729 bytes
1729 bytes
in article ef91ff0.-1@WebX.aaQKaf7vad4, Olivier Berquin wrote:
> I would like to do this think in InDesign: an index from a file.
>
> In other words, I've a text file with a list of 'words'. I would like to
> retrieve these words in my InDesign document.
>
> I've wrote this in QuarkXPress (this part of my script return every page where
> the word 'WordToFind' appears). How I can do this in InDesign ?
>
> set WordToFind to "Hammer"
> set PageList to (page number of page 1 of (every text box whose its text
> contains WordToFind))
Something like this:
tell application "InDesign 2.0.1"
set thePages to {}
tell document 1
repeat with i from 1 to count of pages
set x to search every text frame of page i for "hammer"
try
x
set end of thePages to i
end try
end repeat
end tell
end tell
thePages
--
Shane Stanley, sstanley@myriad-com.com.au
Technical Details
Message-ID:
<B93355E8.33641%sstanley@myriad-com.com.au>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!supernews.com!iad-peer.news.verio.net!news.verio.net!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<ef91ff0.-1@WebX.aaQKaf7vad4>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,dba5b3be0840d143 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2002-06-16 17:07:32 PST From: Shane Stanley <sstanley@myriad-com.com.au> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!supernews.com!iad-peer.news.verio.net!news.verio.net!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: AS: Creation of an index from a text file Message-ID: <B93355E8.33641%sstanley@myriad-com.com.au> Date: Sun, 16 Jun 2002 16:46:31 -0700 References: <ef91ff0.-1@WebX.aaQKaf7vad4> Lines: 36 User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.0.3 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit