Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Done Clipboard monitoring

Oct
3
0
I tried to do a script to be run continuously, monitoring the clipboard. The idea is to use very little CPU, and wake-up when a new text appears in the clipboard.
I need to find out whether the content of the clipboard has been changed. To do that, I need to compare all the %@clip[] until "**EOC**" is found.
This is time consuming, and since it must be repeated continuously, it is inefficient.
Clipboard monitoring would become much easier if we had, for instance, a function to obtain the md5 of the clipboard's content, to be called e.g. md5clip.
By comparing the current md5clip with the previous value, we would immediately realize when the clipboard is changed.
 
If you don't mind an outside solution, take a look at the freeware macro and scripting language AutoHotKey.

It offers functions like ClipWait and onClipboardChange. Integration with TCMD should be possible using the Run command .

Compiled AHK scripts are small and memory-efficient. With a little programming (your own, or that of other users), you can not only monitor the clipboard, but also create multiple clipboards, or append items without overwriting the current content.

Dynamically reassigning keyboard commands and self-expanding abbreviations are other useful features.
 
You might try %@lines[clip:] to see if it changes. I suspect it'll be faster
than using %@clip[] inside the batch file.

On Sat, May 15, 2010 at 2:19 AM, kontamusse <>wrote:


> I tried to do a script to be run continuously, monitoring the clipboard.
> The idea is to use very little CPU, and wake-up when a new text appears in
> the clipboard.
> I need to find out whether the content of the clipboard has been changed.
> To do that, I need to compare all the %@clip[] until "**EOC**" is found.
> This is time consuming, and since it must be repeated continuously, it is
> inefficient.
> Clipboard monitoring would become much easier if we had, for instance, a
> function to obtain the md5 of the clipboard's content, to be called e.g.
> md5clip.
> By comparing the current md5clip with the previous value, we would
> immediately realize when the clipboard is changed.
>
>
>
>
>



--
Jim Cook
2010 Sundays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Monday.
 
Back
Top