You say "if I change it to \r it works fine" -- do you mean that it does *not* work if you leave it that way? Because it should work just fine. (And you actually can have a little fun by inserting all kinds of 'special' characters literally into the Find dialog -- try tab or newline.)
1 person found this helpful
The above jongware given breif details about your mistake and clear your probs.
I have modified you code, please try the below JS code.
app.findGrepPreferences = app.changeGrepPreferences = null; app.findGrepPreferences.findWhat = "(?s)<k6>\\r(.+?\\r)</k6>"; var myResults = app.activeDocument.findGrep(); app.select(myResults);