masvil 3 Posted December 4, 2004 (edited) A clipboard logger, my first script here. Express opinion and/or suggest modifies, please Can it effort CPU? $first = 0 While 1 $clip = ClipGet() If @error = 0 And $first = 0 Then;so that it logs also FIRST content $title = WinGetTitle("") $file = FileOpen(@ScriptDir & "\cliplog.txt", 1) FileWriteLine($file, "[" & $title & "] - " & @MDAY & "/" & @MON & "/" & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC) FileWriteLine($file, $clip & @LF & @LF) FileClose($file) $first = 1 EndIf Sleep(100) $clip2 = ClipGet() If $clip <> $clip2 Then $title = WinGetTitle("") $file = FileOpen(@ScriptDir & "\cliplog.txt", 1) FileWriteLine($file, "[" & $title & "] - " & @MDAY & "/" & @MON & "/" & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC) FileWriteLine($file, $clip2 & @LF & @LF) FileClose($file) EndIf Wend Edited December 4, 2004 by masvil Share this post Link to post Share on other sites
masvil 3 Posted December 5, 2004 (edited) Added: F11 hotkey to open log file HotKeySet("{F11}", "ViewLog") $first = 0 While 1 $clip = ClipGet() If @error = 0 And $first = 0 Then $title = WinGetTitle("") $file = FileOpen(@ScriptDir & "\clip.txt", 1) FileWriteLine($file, "[" & $title & "] - " & @MDAY & "/" & @MON & "/" & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC) FileWriteLine($file, $clip & @LF & @LF) FileClose($file) $first = 1 EndIf Sleep(100) $clip2 = ClipGet() If $clip <> $clip2 Then $title = WinGetTitle("") $file = FileOpen(@ScriptDir & "\clip.txt", 1) FileWriteLine($file, "[" & $title & "] - " & @MDAY & "/" & @MON & "/" & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC) FileWriteLine($file, $clip2 & @LF & @LF) FileClose($file) EndIf Wend Func ViewLog() Run(@ComSpec & " /c start clip.txt", @ScriptDir) EndFunc;==>ViewLog Edited December 5, 2004 by masvil Share this post Link to post Share on other sites
ezzetabi 3 Posted December 5, 2004 (edited) Interesting, but for Autoit limitations it can hold only text. I can't keep many copied files or pictures. Also, useFunc ViewLog() Run(@ComSpec & " /c start clip.txt", @ScriptDir,@sw_hide) EndFunc;==>ViewLog so it does not flash a black screen when using F11. I woud do this way:HotKeySet("{F11}", "ViewLog") $clip = ClipGet() While 1 Sleep(100) $clip2 = ClipGet() If $clip <> $clip2 and $clip2 <> '' Then $clip = $clip2 $title = WinGetTitle("") $file = FileOpen(@ScriptDir & "\clip.txt", 1) FileWriteLine($file, "[" & $title & "] - " & @MDAY & "/" & @MON & "/" & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC) FileWriteLine($file, $clip2 & @LF & @LF) FileClose($file) EndIf Wend Func ViewLog() Run(@ComSpec & " /c start clip.txt", @ScriptDir,@sw_hide) EndFunc;==>ViewLog About CPU, it should be not a problem. Edited December 5, 2004 by ezzetabi Share this post Link to post Share on other sites
masvil 3 Posted December 5, 2004 I woud do this way:Me too Share this post Link to post Share on other sites