in reply to Clipboard to file
Try this. It will time tag and append each clipboard change to a file.
#!/bin/perl -w use strict; use Win32::Clipboard; use FileHandle; my $clipboard = Win32::Clipboard(); #open the log file my $file = 'c:\temp\clip.txt'; open(OUTPUT,">>$file") or die "open: $!"; binmode OUTPUT; autoflush OUTPUT 1; print "Clipboard being saved to $file\n"; print "To exit, CNTL-C out of this window.\n\n\n"; while (1) { $clipboard->WaitForChange(); my $text = $clipboard->GetText(); my $now = localtime(); print "$now: writing " , substr($text,0,40) , "... to $file\n"; print OUTPUT "$now\n$text\n"; } exit; END { close OUTPUT or die "close: $!"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Clipboard to file
by Anonymous Monk on Aug 21, 2001 at 21:54 UTC | |
by Anonymous Monk on Aug 21, 2001 at 22:10 UTC | |
by RhetTbull (Curate) on Aug 21, 2001 at 23:55 UTC | |
by Anonymous Monk on Aug 23, 2001 at 15:57 UTC |
In Section
Seekers of Perl Wisdom