Thread View: adobe.incopy.scripting
7 messages
7 total messages
Started by veronica_olvera
Tue, 24 Mar 2009 20:03
Email Addresses - FindChangeList
Author: veronica_olvera
Date: Tue, 24 Mar 2009 20:03
Date: Tue, 24 Mar 2009 20:03
3 lines
1032 bytes
1032 bytes
I want to apply a style to email address in my copy. I used the following in my FindChangeList.txt file, but it's not working for some reason. Could someone help please? Alternatively, if you know how to style the last two lines of any story, that'd be even better! THANK YOU!
text {findWhat:"\@/:[:space:]]+\>@[a-zA-Z_\.]+?\.[a-zA-Z]{2,3}"} {appliedCharacterStyle:"NewsBriefs_Start"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}
Re: Email Addresses - FindChangeList
Author: 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!");
Re: Email Addresses - FindChangeList
Author: veronica_olvera
Date: Fri, 27 Mar 2009 14:26
Date: Fri, 27 Mar 2009 14:26
4 lines
974 bytes
974 bytes
Thanks Kasyan! I'll try this. Also if anybody can tell me how to find an email address AND the first line above it (sample below), that'd be great. I need to find the last email address in a story and the first line above it, and have a paragraph style applied. I'm definitely a novice with jsx and grep, so all help is greatly appreciated! Thanks again! Writer Name wname@example.com
Re: Email Addresses - FindChangeList
Author: veronica_olvera
Date: Fri, 27 Mar 2009 14:39
Date: Fri, 27 Mar 2009 14:39
3 lines
852 bytes
852 bytes
One other thing -- for some reason this grep isn't finding my email address in InCopy. It's finding it perfectly in InDesign? This is probably a very easy solution that I'm overlooking? Thank you very much! (?i)[A-Z]*?@[A-Z]*?[.]...
Re: Email Addresses - FindChangeList
Author: Kasyan_Servetsky
Date: Sun, 29 Mar 2009 09:16
Date: Sun, 29 Mar 2009 09:16
7 lines
1156 bytes
1156 bytes
Veronica, This script works for me in InCopy as well. I noticed that after running FindChangeByList.jsx my script stops working until I restart the program. May be you have the same problem. But it’s still unclear to me: Do you want to apply "NewsBriefs_Start" character style to an e-mail address and some paragraph style to the line above, or the character/some paragraph style to both? Could you send me an example document? It would be easier to me to help you if I could see the actual file. Kasyan askoldich@yahoo.com
Re: Email Addresses - FindChangeList
Author: veronica_olvera
Date: Fri, 03 Apr 2009 18:10
Date: Fri, 03 Apr 2009 18:10
8 lines
1063 bytes
1063 bytes
Hi Kasyan
Thanks again! To answer your question, I want to apply a paragraph style to the last email address in the story AND the first line above it. So you'd have regular bodytext all the way down to the two last lines which is the author's byline.
This is my story and then my story ends.{BODYTEXT STYLE}
Veronica Olvera {BYLINE STYLE}
veronica@example.com {BYLINE STYLE}
Thanks!!
Re: Email Addresses - FindChangeList
Author: 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!");
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads