Article View: adobe.scripting.indesign
Article #19422Re: New to apple script... is this worth a try?
From: CouponBoy
Date: Wed, 18 Dec 2002 19:58
Date: Wed, 18 Dec 2002 19:58
19 lines
2121 bytes
2121 bytes
Hi, hey here is a little bit that might help get you started:
set mynewtext to "TEST"
tell application "InDesign 2.0.1"
activate
set find preferences to nothing --clear info
set change preferences to nothing
set find text of find preferences to "ABio"
set change text of change preferences to mynewtext
search document 1 with change attributes {changetext:mynewtext, applied font:"Franklin Gothic", font style:"Extra Condensed", horizontal scale:80, tracking:-25}
set find preferences to nothing --reset again
set change preferences to nothing
end tell
in this example, i am using mynewtext as whatever text you want to be the new text. "ABio" is the old text (from one of my scripts i use). When doing a find change, notice you have to set the find parameters, then the change parameters, then do a "search document" with some kind of parameter. You can't just do "seach document"... you have to add "with change attributes {changetext:mynewtext....} etc". You can certainly get more involved in the search, say find only the work "Christmas" that is also the color red and is a certain font.
There are probably more ways to script this but it works for me. I also suggest downloading Adobe's ID scripting guide, and at the Adobe expert center i have posted all the scripts from that PDF to get people started in learning ID scripting.Hope this helps
Chris
Technical Details
Message-ID:
<1de70da9.4@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<1de70da9.-1@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,3d6763be43015f75 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2002-12-18 12:07:56 PST From: CouponBoy <chris.paveglio@clippermagazine.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: New to apple script... is this worth a try? Message-ID: <1de70da9.4@WebX.la2eafNXanI> Date: Wed, 18 Dec 2002 11:58:54 -0800 References: <1de70da9.-1@WebX.la2eafNXanI> Lines: 28 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit