I'd like to paste hex values into UltraEdit, so that they end up as ANSI text.
F.e. the buffer contains:
30:30:31:
I'd like to paste into UltraEdit;
001
Using UltraEdit 14.00b
TIA,
Wessel
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 line = UltraEdit.activeDocument.currentLineNum; /* remember where to insert */
var col = UltraEdit.activeDocument.currentColumnNum; /* remember where to insert */
if (typeof(UltraEdit.activeDocumentIdx) == "undefined") col++;
UltraEdit.activeDocument.top(); /* go to top and paste hex eg. 30:30:31: */
UltraEdit.activeDocument.paste(); /* paste clipboard contents */
UltraEdit.activeDocument.selectToTop(); /* select it */
var oStr = ""; /* outputvariable */
if (UltraEdit.activeDocument.isSel()) { /* is anything selected ? */
var isThisHex = UltraEdit.activeDocument.selection; /* get selected text */
isThisHex = isThisHex.replace(/:/g,""); /* remove semicolons: Before: 30:30:31: After: 303031 */
try {
for (j=0;j<isThisHex.length;j=j+2) { /* iterate jumping 2 positions in each loop */
var iChr = isThisHex.substr(j,2); /* read a single hex escaped character */
if(iChr=="00") { /* hex 00 is suppressed as blank */
iChr="20"; /* hex 20 = blank */
}
// Un-escape two character hex into single character
oStr = oStr + String.fromCharCode(parseInt( iChr, 16 ));
}
}
catch (conversionError) {
/* do nothing if it can't be converted - Insert your own error handling */
}
}
UltraEdit.activeDocument.deleteText(); /* delete pasted contents after it is retrieved */
UltraEdit.activeDocument.gotoLine(line,col); /* go to original position in document */
UltraEdit.activeDocument.write(oStr); /* write converted string */
