Article View: adobe.scripting.indesign
Article #1506Re: Find some characters and replace with character style...
From: thiyagus5
Date: Thu, 05 Feb 2009 01:37
Date: Thu, 05 Feb 2009 01:37
28 lines
1526 bytes
1526 bytes
Hi Ole,
What you said is correct. I am creating the character style but it is not inside the style group. Then finding those characters and apply character style for it. Unfortunately the find & change process defined as a function, then only it doesn't run properly. Now below script is working fine.
===============
var myDoc = app.activeDocument;
with(app.activeDocument){
myNewCharStyle = characterStyles.add();
with(myNewCharStyle){
name= "x"
fontStyle = "Roman"
}}
app.findTextPreferences.findWhat = "^>";
app.changeTextPreferences.appliedCharacterStyle = myNewCharStyle;
//Add a line to perform the change:
app.documents.item(0).changeText();
app.findTextPreferences.findWhat = "^m";
app.changeTextPreferences.appliedCharacterStyle = myNewCharStyle;
//Add a line to perform the change:
app.documents.item(0).changeText();
==============
Thanks for your kind support.
Regards
Thiyagu
Technical Details
Message-ID:
<59b7c3f6.3@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!newshub.sdsu.edu!webcrossingReferences:
<59b7c3f6.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,bbfbdca5e7f228aa X-Google-Attributes: gidf939a,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: thiyagus5@adobeforums.com Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.scripting.indesign Subject: Re: Find some characters and replace with character style... Message-ID: <59b7c3f6.3@webcrossing.la2eafNXanI> Date: Wed, 4 Feb 2009 17:37:52 -0800 References: <59b7c3f6.-1@webcrossing.la2eafNXanI> Lines: 32 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit