Article View: adobe.incopy.scripting
Article #70Re: Email Addresses - FindChangeList
From: Kasyan_Servetsky
Date: Wed, 25 Mar 2009 21:37
Date: Wed, 25 Mar 2009 21:37
26 lines
1784 bytes
1784 bytes
Hi Veronica,
I have no idea why FindChangeByList.jsx script doesn't work. What strikes my eye is that your line contains mistakes:
Instead of "text" it should be "grep" – this is a GREP search
You can't use 'wholeWord:false' in GREP search. Do you see 'Whole Word' in GREP panel?
Anyway, It's much easier to write a script from scratch.
Kasyan
app.findGrepPreferences = app.changeGrepPreferences = null;
var myCharacterStyle = app.activeDocument.characterStyles.item("NewsBriefs_Start");
if (myCharacterStyle == null) {
alert("Character style \"NewsBriefs_Start\" doesn't exist in the current document.");
exit();
}
app.findChangeGrepOptions.includeFootnotes = true;
app.findChangeGrepOptions.includeHiddenLayers = true;
app.findChangeGrepOptions.includeMasterPages = true;
//Regular expression for finding an email address.
app.findGrepPreferences.findWhat = "(?i)[A-Z]*?@[A-Z]*?[.]...";
app.changeGrepPreferences.appliedCharacterStyle = myCharacterStyle;
app.activeDocument.changeGrep();
app.findGrepPreferences = app.changeGrepPreferences = null;
alert("All done!");
Technical Details
Message-ID:
<59b865bb.0@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!newshub.sdsu.edu!webcrossingReferences:
<59b865bb.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: 1efe4a,af1cc97d0ff8f35d X-Google-Attributes: gid1efe4a,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: Kasyan_Servetsky@adobeforums.com Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.incopy.scripting Subject: Re: Email Addresses - FindChangeList Message-ID: <59b865bb.0@webcrossing.la2eafNXanI> Date: Wed, 25 Mar 2009 14:37:18 -0700 References: <59b865bb.-1@webcrossing.la2eafNXanI> Lines: 23 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit