🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #9652

JS CS2 Find/Change query

#9652
From: CariJansen
Date: Wed, 16 Aug 2006 04:27
29 lines
1753 bytes
Am wondering whether the following is possible, with JS for InDesign...

I have a long document (300+ pages), it has a producer-listings, containing lost of different type of information.

E.g.
Location (a heading with paragraph style "myChange")
Description (e.g. Perth, Melbourne, Sydney, text with paragraph style "myFind").

If the description contains "," or "and", then the word "Location" is to be changed to "Locations"

I've started writing the script but don't think I can populate an array with paragraph numbers and reuse these to locate only selectively the "myChange" texts that need to be amended in different paragraphs. Am wondering if I'm barking up the 'wrong tree' with use of search().



 
myFindAction = myStory.search(myFindString, true, true, myFindString, {appliedParagraphStyle:myFind}, {appliedParagraphStyle:myFind}); 


This will find all of them, but doesn't actually record where things were found?



 
myChangeAction = myStory.search(myChangeString, true, true, myChangeToString, {appliedParagraphStyle:myChange},{appliedParagraphStyle:myChange}); 


This will change all of them, but not selectively.

Any ideas in the right direction would be heaps appreciated.
Technical Details
Message-ID: <3bc146f3.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.volia.net!news.ecp.fr!news.stben.net!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,7b7786914afaf3c
X-Google-Attributes: gidf939a,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: CariJansen@adobeforums.com
Newsgroups: adobe.scripting.indesign
Subject: JS CS2 Find/Change query
Message-ID: <3bc146f3.-1@webcrossing.la2eafNXanI>
Date: Tue, 15 Aug 2006 21:27:02 -0700
Lines: 33
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.volia.net!news.ecp.fr!news.stben.net!webcrossing