#10403
Yutaka Emura
キーマスター

psum 様

いつも EmEditor Professional をお使いいただき、誠にありがとうございます。

確かに、マクロだと1回の「元に戻す」で戻らないですね。
スニペットで、「スニペットの新規作成」を行い、以下のように、マクロを `# … ` で囲ってテキストにしておくと、1回の「元に戻す」で戻ります。この方法でよろしければお試しください。

`# myNow = new Date();
myYear = myNow.getYear()
myYear4 = (myYear < 2000) ? myYear+1900 : myYear;
myMonth = myNow.getMonth () + 1;
myDate = myNow.getDate ();
myDay = myNow.getDay ();
myHours = myNow.getHours ();
myMinutes = myNow.getMinutes();
mySeconds = myNow.getSeconds();
myDateTime = ""; myDateTime += myYear4 + "/";
if ((myMonth + "").length < 2) { myDateTime += "0"; } myDateTime += myMonth + "/";
if ((myDate + "").length < 2) { myDateTime += "0"; } myDateTime += myDate;
myaWeekDay = new Array("日","月","火","水","木","金","土");
myDateTime += "(" + myaWeekDay[myDay] + ")";
if ((myHours + "").length < 2) { myDateTime += "0"; } myDateTime += myHours + ":";
if ((myMinutes + "").length < 2) { myDateTime += "0"; } myDateTime += myMinutes + ":";
if ((mySeconds + "").length < 2) { myDateTime += "0"; } myDateTime += mySeconds + " ";
document.selection.StartOfLine();
document.selection.NewLine(1);
document.write("——————————————————————————");
document.selection.NewLine(1);
document.write(myDateTime);
document.selection.EndOfLine();
document.selection.NewLine(10);
document.selection.LineUp(0, 9);
document.write("・");
`

どうぞよろしくお願い申し上げます。