Also, im trying to find and replace like this, but this works only if the contents are in indesign.
myS = Folder("/Users/wleastudio/Desktop/For Chennai/").getFiles("*"); //remove links from Desktop
for ( i = 0; i < myS.length; i++ )
{
var nn = myS[i];
nt = [];
nt.push(nn);
app.findGrepPreferences.findWhat = "XX_(\\d+)+_(\\w)+.ttjs";
app.changeGrepPreferences.changeTo = "XX_ $1.ttjs";
app.changeGrep();
}
this is not working for a files that is inside a folder on desktop.