for (j=0; j > myFound.length; j++)
var LamanNgCbib = myFound[j].contents.slice(1,-1);
var dar = LamanNgCbib.replace(/\uFEFF/g, '');
var expanded = unrange(dar);
app.activeDocument.search( dar, false, false, expanded )
function unrange (s)
return s.replace (/(\d+)\u2013(\d+)/g, expand)
function expand ()
var expanded = ;
var start = Number (arguments);
var stop = Number (arguments);
for (var i = start; i <= stop; i++)
The script only replaces the first instance ([1,3,5-7] becomes [1,3,5,6,7,8]) but the rest does not. so i have to run the script again for the others to unrange and wait forever 'til the script finished. Is there anyway to loop my search and replace so i have to run the script only once? Please i really need your help scripters.
I owe you one Dave. The first time you replied i didn't get what you mean. And I thought I was doing it the wrong way when you said I don't have to search again. But now it works like magic! Thanks a lot! By the way your blog is great. It helps me a lot. Thanks. Thanks. Thanks.