Welcome to the IDM Forum. This forum is meant as a user-to-user support mechanism where users can share knowledge and tips for all IDM software.
Since these forums are user-to-user based, IDM does not regularly read or reply to the posts in this forum. For problem reports, suggestions, or feature requests, you must email us directly. Our trained technical support staff answers most inquiries within 30 minutes.

var nFileCount = UltraEdit.document.length;
if (nFileCount > 0) {
var nIndexOfActiveFile = UltraEdit.activeDocumentIdx;
var nFileIndex = 0;
do {
if (UltraEdit.document[nFileIndex].isName("") &&
UltraEdit.document[nFileIndex].fileSize > 0) {
UltraEdit.document[nFileIndex].setActive();
UltraEdit.saveAs("C:\\Temp\\TempFile_"+nFileIndex+".txt");
}
} while (++nFileIndex < nFileCount);
UltraEdit.document[nIndexOfActiveFile].setActive();
}var nFileCount = UltraEdit.document.length;
if (nFileCount > 0) {
var nFileIndex = 0;
do {
if (UltraEdit.document[nFileIndex].isName("")) {
if (UltraEdit.document[nFileIndex].fileSize > 0) {
UltraEdit.document[nFileIndex].setActive();
UltraEdit.saveAs("C:\\Temp\\TempFile_"+nFileIndex+".txt");
} else {
UltraEdit.closeFile(UltraEdit.document[nFileIndex].path,2);
nFileCount--;
nFileIndex--;
}
}
} while (++nFileIndex < nFileCount);
UltraEdit.saveAll(); // Save all modified named files
}

function getActiveDocumentIndex() {
var tabindex = -1; /* start value */
for (var i = 0; i < UltraEdit.document.length; i++)
{
if (UltraEdit.activeDocument.path==UltraEdit.document[i].path) {
tabindex = i;
break;
}
}
return tabindex;
}
var nFileCount = UltraEdit.document.length;
if (nFileCount > 0) {
var nIndexOfActiveFile = 0;
if (typeof(UltraEdit.activeDocumentIdx) != "number") {
nIndexOfActiveFile = getActiveDocumentIndex();
} else {
nIndexOfActiveFile = UltraEdit.activeDocumentIdx;
}
var nFileIndex = 0;
do {
if (UltraEdit.document[nFileIndex].isName("") &&
UltraEdit.document[nFileIndex].fileSize > 0) {
UltraEdit.document[nFileIndex].setActive();
UltraEdit.saveAs("C:\\Temp\\TempFile_"+nFileIndex+".txt");
}
} while (++nFileIndex < nFileCount);
UltraEdit.document[nIndexOfActiveFile].setActive();
}
function S4() {
return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
}
function guid() {
return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4());
}
function getActiveDocumentIndex() {
...
//UltraEdit.saveAs("C:\\Temp\\TempFile_"+nFileIndex+".txt");
UltraEdit.saveAs("C:\\Temp\\TempFile_"+guid()+".txt");
}


fredtheman wrote:BTW, what tool do you use to debug a JavaScript script? I had a typo somewhere, and it took me 15 min to figure it out, since UE doesn't return any info
try {
var b = 1;
var a = nonexistingFunc();
UltraEdit.outputWindow.write("a+b="+a+b);
}
catch (err) {
UltraEdit.outputWindow.write(err.toString());
}

if (UltraEdit.document[nFileIndex].isName("") && UltraEdit.document[nFileIndex].fileSize > 0)