下がりますように。なくなりますように。1行に1価格とします。
function main (){ var Doc = app.activeDocument; app.findGrepPreferences=app.changeGrepPreferences=NothingEnum.NOTHING; app.findGrepPreferences.findWhat="(?<=価格)[0-9,]+"; var Gr=Doc.findGrep(); for (var i=0; i<Gr.length; i++) { var x1=Gr[i].contents; var x2=Math.round(x1.replace(/,/g,"")*1.05);//5% x2=String(x2).replace( /(\d)(?=(\d\d\d)+(?!\d))/g, '$1,' );//3桁区切り app.findGrepPreferences.findWhat="(?<=税込)[0-9,]+"; app.changeGrepPreferences.changeTo=x2; Gr[i].paragraphs[0].changeGrep(); } app.findGrepPreferences=app.changeGrepPreferences=NothingEnum.NOTHING; } app.doScript (main, ScriptLanguage.JAVASCRIPT, [], UndoModes.FAST_ENTIRE_SCRIPT);