Now, I try this to get the current document name only.
- Code: Select all
var filepath = UltraEdit.activeDocument.path + "\r\n";
var i = filepath.lastIndexOf("\\");
var filename = filepath.slice(i + 1);
And now there is another problem, maybe it is a bug.
I want to get the current date only. not include the time. So I use below.
- Code: Select all
var d = new Date();
UltraEdit.activeDocument.write(d.getFullYear() + "-");
UltraEdit.activeDocument.write(d.getMonth() + "-"); \\ note here!
UltraEdit.activeDocument.write(d.getDate() + "\r\n");
but the result is always less than current month 1 month. I mean now it is Apri, but the answer is March. well I change it to March and get Feb instead. And only getMonth/getUTCMonth works like this.Why?