just enter a regex like you would in regex rename and it will apply it on the selected files.
the script also saves the regex on an ini file for quick use the next time you run it.
Code: Select all
"Text Replacer v1"
$sep=getkey(RegExpRenameSep,general);
end (getinfo(countselected)<1);
getkey $last,last,text_loop,"script_settings.ini";
$regex=input("Enter RegEx","<match>$sep<replace>,$last");
setkey $last,last,text_loop,"script_settings.ini";
$filelist = getinfo('SelectedItemsPathNames','|');
$count=1;
while(1){
$file=gettoken($filelist,$count,"|");
if("$file"==""){break;}
$match=gettoken($regex,1,$sep);
$rep=gettoken($regex,2,$sep);
$data=regexreplace(readfile($file),$match,$rep);
writefile($file,$data);
$count++;}
status "Done!",,ready;