I was trying to make macro to mark page, as when you read a book you use a paper to mark where you left the reading. But as i said the focus doesn't go to the highlighted text, the macro was this:
NOTE THAT THE VARIABLES AND FUNCTIONS NAMES ARE IN SPANISH.
THE FIRST AND SECOND FUNCTION ARE TO USE IN MENUS.CFG OR ACCEL.CFG.
### MARCA PAGINAS
marcapagina{
$salvaclip = getclipboard();
id(ID_EDIT_COPY);
$marcastr = getclipboard();
$marca=setpref(STRING, "marcapaginas.".$url, $marcastr);
setclipboard($salvaclip);
}
recuperapagina{
$marca=getpref(STRING, "marcapaginas.".$url);
$marca != "" ? &mihighlight:alert("Lo siento, no hay marcapágina para esta página, revisa la URL.");
}
mihighlight{
open("javascript
function(){var count=0, text, dv;text='".$marca."';dv=document.defaultView;function searchWithinNode(node, te, len){var pos, skip, spannode, middlebit, endbit, middleclone;skip=0;if( node.nodeType==3 ){pos=node.data.toUpperCase().indexOf(te);if(pos>=0){spannode=document.createElement(%22SPAN%22);spannode.style.backgroundColor=%22yellow%22;middlebit=node.splitText(pos);endbit=middlebit.splitText(len);middleclone=middlebit.cloneNode(true);spannode.appendChild(middleclone);middlebit.parentNode.replaceChild(spannode,middlebit);++count;skip=1;}}else if( node.nodeType==1&& node.childNodes&& dv.getComputedStyle(node, null).getPropertyValue(%22display%22)!=%22none%22){for (var child=0; child < node.childNodes.length; ++child){child=child+searchWithinNode(node.childNodes[child], te, len);}}return skip;}window.status=%22Searching for '%22+text+%22'...%22;searchWithinNode(document.body, text.toUpperCase(), text.length);window.status=%22Found %22+count+%22 occurrence%22+(count==1?%22%22:%22s%22)+%22 of '%22+text+%22'.%22;})();");
}