Article View: adobe.incopy.scripting
Article #79Re: Email Addresses - FindChangeList
From: veronica_olvera
Date: Fri, 03 Apr 2009 19:01
Date: Fri, 03 Apr 2009 19:01
23 lines
1669 bytes
1669 bytes
Apologies for all the postings, but I have a breakthrough. The below Grep works in INDESIGN. However, I need two things:
1) I need it to work in INCOPY
2) I need it to apply a paragraph style, NOT a character style
All help is appreciated.
app.findGrepPreferences = app.changeGrepPreferences = null;
var myCharacterStyle = app.activeDocument.characterStyles.item("Hyperlink");
if (myCharacterStyle == null) {
alert("Character style \"Hyperlink\" 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 = ".*\r(?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.5@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.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: veronica_olvera@adobeforums.com Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.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.5@webcrossing.la2eafNXanI> Date: Fri, 3 Apr 2009 12:01:22 -0700 References: <59b865bb.-1@webcrossing.la2eafNXanI> Lines: 26 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit