-
1. Re: GREP FindChangebyList Error Help
Reese 0o0o Mar 31, 2011 2:11 PM (in response to adobechr)You just need an extra \ before every any digit code.
You had:
"(\d|\d+.?\d+?)(?:g fiber/)"
You need:
"(\\d|\\d+.?\\d+?)(?:g fiber/)"
I tested it with your sample and it worked.
Hope that helps.
-
2. Re: GREP FindChangebyList Error Help
adobechr Mar 31, 2011 4:12 PM (in response to Reese 0o0o)Darn, still get that Java 25 error.
I changed the file to this:
grep {find what:"(\\d|\\d+.?\\d+?)(?:g fiber/)"} {change to:"$1|"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Strip just the number i.e. 2.78g fiber
Used text editor and saved as a UTF-8 and as well as Wester (Mac OS Roman)... I read somewhere this script only like certain kind of formats. I am stumped.
Any other ideas? Thanks!
-
3. Re: GREP FindChangebyList Error Help
Reese 0o0o Mar 31, 2011 4:31 PM (in response to adobechr)Here is the code I used stripped to its basic elements. With a new document with 1 text box and your sample text. Perhaps the error is somewhere besides the grep syntax, because that seems to work fine.
var myDocument = app.activeDocument;
var myTextFrame1 = myDocument.textFrames.item(0);
app.findGrepPreferences = app.changeGrepPreferences = null;
//app.findGrepPreferences.findWhat = "(\d|\d+.?\d+?)(?:g fiber/)";
app.findGrepPreferences.findWhat = "(\\d|\\d+.?\\d+?)(?:g fiber/)";
//app.changeGrepPreferences.changeTo = "$1|";
app.changeGrepPreferences.changeTo = "$1|";
myTextFrame1.changeGrep();
app.findGrepPreferences = app.changeGrepPreferences = null;
-
4. Re: GREP FindChangebyList Error Help
[Jongware] Mar 31, 2011 4:41 PM (in response to adobechr)Does this script still desperately need its {items} separated by Tabs?
-
5. Re: GREP FindChangebyList Error Help
adobechr Mar 31, 2011 5:32 PM (in response to [Jongware])Started over by using a script that I knew and copying in the new grep info. It worked... it must have been tabs (although I checked that). Thanks guys... the double backslash was the first problem -- tabs second.
Thanks.