Article View: adobe.scripting.indesign
Article #19302Please, help with find and replace within a specific object (Text Frame?).
From: Iolaire McFadden
Date: Fri, 20 Dec 2002 14:19
Date: Fri, 20 Dec 2002 14:19
20 lines
2279 bytes
2279 bytes
Hello, I'm trying to generate multiple InDesign Files from a complete (template like) file. In my process I need to change all of the links and then adjust the headers and footers. I can change the links no problem, and even change various header items using Script Labels like this:
header_content = my_item.Item(itemloop).Label
If header_content = "Left_Header" Then
Set myimage = mypage.PageItems.Item("Left_Header")
myimage.Contents = "Year-End 2002 � WASHINGTON, D.C. "
But I'm having a hard time selecting specific words from an item (I'm assuming it's a Text Frame as it contains text?). For example in the code above what if I only want to change WASHINGTON, D. C. to say CHICAGO and not the date. This is because it's formatting is different than the date (I'm assuming that it is just as easy to find and replace as it is to find and change formatting).
Set myimage = mypage.PageItems.Item("Left_Header")
myimage.Search "WASHINGTON, D.C.", False, False, "CHICAGO"
I've tried various methods like this and its not working. My best guess is that I need to change the myimage object selection to another object type like a textframe.
Please can someone help point me in the right direction?
Thank you,
iolaire
PS: This works on the entire document, but I don't want to use it incase we have market names in the document body or introductions.
myInDesign.FindPreferences = idNothing
myInDesign.ChangePreferences = idNothing
Technical Details
Message-ID:
<1de71592.-1@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!newsfeed.tpinternet.pl!newsfeed01.sul.t-online.de!t-online.de!WebXShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f939a,88594b52b8ecdcde,start X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2002-12-20 06:38:07 PST From: "Iolaire McFadden" <imcfadden@costar.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!newsfeed.tpinternet.pl!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Please, help with find and replace within a specific object (Text Frame?). Message-ID: <1de71592.-1@WebX.la2eafNXanI> Date: Fri, 20 Dec 2002 06:19:37 -0800 Lines: 31 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit