I am trying to de-select previosly selected text (select nothing) after having selected and copied it with Keypress events:
EVENT TYPE=KEYPRESS CHAR="a" MODIFIERS="ctrl"
EVENT TYPE=KEYPRESS CHAR="c" MODIFIERS="ctrl"
I have already tried using the CLICK and DBLCLICK events on random elements of the page, also using alternative mouse buttons (1,2) e.g.:
EVENT TYPE=CLICK SELECTOR="HTML>BODY>TABLE>TBODY>TR>TD>TABLE:nth-of-type(4)>TBODY>TR>TD:nth-of-type(3)>TABLE>TBODY>TR:nth-of-type(4)>TD>TABLE:nth-of-type(2)>TBODY>TR:nth-of-type(5)>TD>TABLE>TBODY>TR>TD:nth-of-type(2)" BUTTON=0
and also using XPATH instead:
EVENT TYPE=CLICK XPATH="/html/body/table/tbody/tr/td[1]/table[4]/tbody/tr[1]/td[3]/table/tbody/tr[4]/td/table[2]/tbody/tr[1]/td/table/tbody/tr/td[1]/strong" BUTTON=0
In both cases the targeted elements are marked but nothing else happens. The target is a simple html document structured by tables containing mostly text.
I also tried to use CLICK with point coordinates: CLICK X=784 Y=166
And, as suggested in other questions, to use a short delay before the event: WAIT SECONDS=1
Please note, that the first event (EVENT TYPE=KEYPRESS CHAR="a" MODIFIERS="ctrl") works flawlessly.
Edit: The version of iMacros for Firefox I was using, was 9.03, the accepted solution works only up to 8.97.
If there are no input elements on the webpage, let's append one:
EVENT TYPE=KEYPRESS CHAR="a" MODIFIERS="ctrl"
EVENT TYPE=KEYPRESS CHAR="c" MODIFIERS="ctrl"
WAIT SECONDS=1
URL GOTO=javascript:(function(){var<SP>t=document.createElement("input");t.setAttribute("id","tempInput");document.body.appendChild(t);})();
EVENT TYPE=CLICK SELECTOR="#tempInput" BUTTON=0
URL GOTO=javascript:(function(){var<SP>t=document.querySelector("#tempInput");document.body.removeChild(t);})();
Obviously, this solution is far from ideal but it does its work (except 'iMacros for Firefox' v.9.0.3).