Second script:
var doc = app.documents; app.findTextPreferences = null; app.findTextPreferences.underline = true; app.findTextPreferences.underlineColor = "red"; for(var i=0;i<doc.length;i++) { var found = doc[i].findText(); var _contents = []; if(found.length>0) { var _file = new File(doc[i].fullName.toString().replace(/\.indd$/i,".txt")); _file.open('w'); for(var j=0;j<found.length;j++) { _file.write(found[j].contents + "\r"); } } _file.close(); } app.findTextPreferences = null;
Regards,
Chinna