🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #14898

Re: [VB] Tough nut to crack, generate an index

#14898
From: Richard_Ronnback
Date: Thu, 15 Jan 2004 22:20
63 lines
3088 bytes
Raymond, 

InDesign does not support grep searches so you will have to attack it in a
slightly different way. You could try to use the find method and search for
~ which InDesign.

The result of the search will be an array. However, I think that InDesign
will not consider that tilde-sign as belonging to the following word.

To get the word I think you have to loop through the array, grab the
character index, (index, meaning the character's position in the text flow)
increase it with +1 (so you end up in the following word)  and then ask that
increased character for it's parent word. Once you got it you can do what
ever you want with it.

If you add or remove characters you will have to loop backwars, otherwise
you will destroy you references.




On 04-01-15 22.36, in article
3A6F59D826A18A439BEAC32F8FAD4A2416F4AF@hq00s10024.practicewares.net,
"Raymond_Messier@adobeforums.com" <Raymond_Messier@adobeforums.com> wrote:

> I need to generate an index in VB Script. So far I know what I have to
> do, and here is how I was figuring on doing it. I use InData to spray
> the text in. Around the words I want to index I drop a glyph to mark it.
> So, what I need to do is to do a search and replace for what is between
> the glyphs and exchange it with an Index marker of some sort. Has anyone
> done something like this? Basically what I want to do it...
> 
> So I would have text that looked like this
> 
> ~Important Header~
>  Here is the text for the important header
> 
> ~A somewhat more important header~
>  Here is the text for the more important header
> 
> For each word in document
> get word
> if word begin with "~"
> select from start of "~" to end character (1st instance)
> remove special_chars
> insert index entry from selected text
> end if
> Next word
> 
> 
> 
> I cannot figure out how to do the replace or the index entry?! Can
> anyone help?
> 
> 
> =========================================
> Raymond Messier     Software Programmer
> Practicewares Dental Supply
> voice...: (916) 638-8020   ext. 3108
> fax.....: (916) 638-9307
> email...: rmessier@practicewares.com
> =========================================
> 
Technical Details
Message-ID: <BC2CD0A9.206E3%richard.ronnback@telia.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-09!supernews.com!diablo.theplanet.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!webx
References: <3A6F59D826A18A439BEAC32F8FAD4A2416F4AF@hq00s10024.practicewares.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,9f6ae244800c3853
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2004-01-15 14:38:01 PST
From: Richard_Ronnback@adobeforums.com
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-09!supernews.com!diablo.theplanet.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!webx
Newsgroups: adobe.scripting.indesign
Subject: Re: [VB] Tough nut to crack, generate an index
Message-ID: <BC2CD0A9.206E3%richard.ronnback@telia.com>
Date: Thu, 15 Jan 2004 14:20:09 -0800
References: <3A6F59D826A18A439BEAC32F8FAD4A2416F4AF@hq00s10024.practicewares.net>
Lines: 76
User-Agent: Microsoft-Entourage/10.1.4.030702.0
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit