Copy link to clipboard
Copied
Hi I wanna grep just first the first match not all of them here the example:
text:
PP111111
PP222222
PP333333
and here the code
app.findGrepPreferences.findWhat = "^PP[0-9]{6,6}?$";
app.changeGrepPreferences.changeTo = "something";
then I wanna text change to this:
something
PP222222
PP333333
how Can I do this?
Hi,
Try below code.
app.findGrepPreferences.findWhat = "^PP\\d{6}?$";
var findTarget = app.activeDocument.findGrep();
findTarget[0].contents = "something";
Copy link to clipboard
Copied
Hi,
Try below code.
app.findGrepPreferences.findWhat = "^PP\\d{6}?$";
var findTarget = app.activeDocument.findGrep();
findTarget[0].contents = "something";