=====================================
名前:テンプレから置換マクロ
版:1.0
用途:テンプレを埋めながら文章を作成したい場合に使えます。
コメント:
・コピーファイルを自動作成して作業を行います。
・<>のように記述されたところを自動検出します。
・<>のように記述すれば初期値が設定できます。
=====================================
document.selection.selectAll();
document.selection.Copy();
var ConfigName = document.ConfigName;
var Encoding = document.Encoding;
editor.ExecuteCommandByID(4123);
document.ConfigName = ConfigName;
document.Encoding = Encoding;
document.selection.selectAll();var text = document.selection.Text;
while ( text.match(/<>/) ) {
var fromStr = RegExp.$1;
var fromView = fromStr.replace( /((.*?))$/, ” );
var init = RegExp.$1;
var toStr = prompt( fromView, init );
var quotemeta = fromStr.replace(/[^A-Za-z_0-9]/g, “$&”);
var fromReg = new RegExp( “<>”, “gm” );
text = text.replace( fromReg, toStr );
}document.selection.Text = text;
このスレ投稿にはこちらのテンプレをお使いいただけます。
=====================================
名前:<>
版:<>
用途:<>
コメント:<>
=====================================