Article View: adobe.scripting.indesign
Article #21065Re: Find/Change by list
From: Olav Kvern
Date: Tue, 14 May 2002 00:07
Date: Tue, 14 May 2002 00:07
17 lines
2265 bytes
2265 bytes
John--
Sure. This is a little bit trickier, because we first find the phrases we're looking for, then we tell the found text objects (the result of the search) to search themselves for the characters we want to change. Add this bit following the line "Rem Set the find/change preferences back to their default state."
Set myFoundItems = myStory.Search("Both A and B", False, False) For myCounter = 1 To myFoundItems.Count Rem Now tell each found item to search for "A" and change its formatting. Set myFoundItem = myFoundItems.Item(myCounter) myFoundItem.Search "A", True, True, "A" myFoundItem.Search "B", True, True, "B" Next Set myFoundItems = myStory.Search("Neither A nor B", False, False) For myCounter = 1 To myFoundItems.Count Rem Now tell each found item to search for "A" and change its formatting. Set myFoundItem = myFoundItems.Item(myCounter) myFoundItem.Search "A", True, True, "A" myFoundItem.Search "B", True, True, "B" Next
Once you've got the script working the way you want, create an executable file--you do this by choosing "make" from the VB file menu. This creates an application--but the application, or a shortcut to it--in the Script folder and you'll be able to start it from inside InDesign.
Let me know if this works for you!
re: "Has anyone told you what a gold mine you are?"
I'm hoping Adobe will, at my next job performance review.<g>
Thanks,
Ole
Technical Details
Message-ID:
<ef87fb9.1@WebX.aaQKaf7vad4>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!supernews.com!priapus.visi.com!news-out.visi.com!hermes.visi.com!news.tele.dk!small.news.tele.dk!194.213.69.151!news.algonet.se!algonet!news000.worldonline.se!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<ef87fb9.-1@WebX.aaQKaf7vad4>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,436d612f4d917081 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2002-05-13 17:37:37 PST From: "Olav Kvern" <okvern@adobe.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!supernews.com!priapus.visi.com!news-out.visi.com!hermes.visi.com!news.tele.dk!small.news.tele.dk!194.213.69.151!news.algonet.se!algonet!news000.worldonline.se!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: Find/Change by list Message-ID: <ef87fb9.1@WebX.aaQKaf7vad4> Date: Mon, 13 May 2002 17:07:02 -0700 References: <ef87fb9.-1@WebX.aaQKaf7vad4> Lines: 40 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit