2009/12/10 Chris Dekter <
cde...@gmail.com>:
> 2009/12/10 Johnny Rosenberg <
gurus....@gmail.com>:
>> Assigned the script to alt+ctrl+shift+m. Highlighted ”2*4”, pressed
>> ctrl+shift+alt+m, nothing happened. Hit ctrl+v, the result was 88… (8
>> typed twice).
>
> I would get rid of the clipboard.fill_clipboard() statement. It's
> better to just send the output via keyboard.send_keys(). Either that
> or cross-check your script against Derek's original script - it
> doesn't quite match and that's why it's not working for you.
Strange… I copied and pasted it directly… and I can't see the
difference. Here's what I have:
from __future__ import division # Ensures floating point division.
from math import *
text = clipboard.get_selection()
number = eval(text)
output = str(number)
clipboard.fill_clipboard(output)
keyboard.send_keys("<ctrl>+v")
Derek originally had ”keyboard.send_keys(output)” as his last row, but
he said that I should replace it by the one I have now:
Derek said: ”Actually, that last line should be...
keyboard.send_keys("<ctrl>+v")”
Or am I missing something else?
Johnny Rosenberg