FinalVersion Posted March 12, 2010 Share Posted March 12, 2010 (edited) Notes: Simple, but I find this extremely useful.Hotkeys:Ctrl + Home (Clear the clipboard)Ctrl + Page Up (Read the clipboard)Ctrl + End (Exit the program)ToDo:Load File Into Clipboard With Hotkey.Your Suggestions!expandcollapse popup#cs ---------------------------------------------------------------------------- Author: -> Final Version Version: -> 3.3.5.6 <Beta> Function: -> Simple clipboard tool, but could potentially but useful for nurmerous people.s #ce ---------------------------------------------------------------------------- #include <Misc.au3> Opt("TrayMenuMode", 3) $tClear = TrayCreateItem("-> Clear The Clipboard") $tRead = TrayCreateItem("-> Read The Clipboard") $tExit = TrayCreateItem("-> Exit Program") While 1 $tMsg = TrayGetMsg() Select Case $tMsg = $tClear ClearTheClip() Case $tMsg = $tRead ReadTheClip() Case $tMsg = $tExit End() EndSelect If _IsPressed("11") And _IsPressed("24") Then ClearTheClip() ElseIf _IsPressed("11") And _IsPressed("21") Then ReadTheClip() ElseIf _IsPressed("11") And _IsPressed("23") Then End() EndIf WEnd Func ClearTheClip() ClipPut(""); EndFunc ;==>ClearTheClip Func ReadTheClip() $sRead = ClipGet(); If $sRead = "" Then TrayTip("Current Clip Contents", "Clipboard doesn't contain anything!", 3, 1); ElseIf $sRead = " " Then ;==> This is for my personal use, I got into the habit of clearing my clipboard by cutting a space in a text field. TrayTip("Current Clip Contents", "Clipboard contained a space, I'll empty it for you...", 3, 1); ClipPut("") Else TrayTip("Current Clip Contents", $sRead, 3, 1); EndIf EndFunc ;==>ReadTheClip Func End() Exit EndFunc ;==>End Edited March 12, 2010 by FinalVersion krasnoshtan 1 [center][+] Steam GUI [+][+] Clipboard Tool [+][+] System :: Uptime [+][+] StarCraft II Mouse Trap [+][/center] Link to comment Share on other sites More sharing options...
Shafayat Posted March 12, 2010 Share Posted March 12, 2010 I'd prefer using ispressed() udf or wm events instead of hotkeyset to avoid blocking functionality of other software using the same hotkey. I know this because I made the same mistake once. [Not using this account any more. Using "iShafayet" instead] Link to comment Share on other sites More sharing options...
FinalVersion Posted March 12, 2010 Author Share Posted March 12, 2010 (edited) Yeah I noticed the interference with firefox trying to create a New Tab. Will fix asap. Edit: Done. Edited March 12, 2010 by FinalVersion [center][+] Steam GUI [+][+] Clipboard Tool [+][+] System :: Uptime [+][+] StarCraft II Mouse Trap [+][/center] Link to comment Share on other sites More sharing options...
Shafayat Posted March 12, 2010 Share Posted March 12, 2010 You might add option to automatically output clipboard text. I remember I saw a udf for that. Search for "_clipboard_getall" and you'll probably find it. [Not using this account any more. Using "iShafayet" instead] Link to comment Share on other sites More sharing options...
FinalVersion Posted March 12, 2010 Author Share Posted March 12, 2010 What do you mean, automatically output the clipboard text? [center][+] Steam GUI [+][+] Clipboard Tool [+][+] System :: Uptime [+][+] StarCraft II Mouse Trap [+][/center] Link to comment Share on other sites More sharing options...
Shafayat Posted March 12, 2010 Share Posted March 12, 2010 I mean show the traytip you are using whenever data in clipboard changes. [Not using this account any more. Using "iShafayet" instead] Link to comment Share on other sites More sharing options...
FinalVersion Posted March 12, 2010 Author Share Posted March 12, 2010 Ok will add that. [center][+] Steam GUI [+][+] Clipboard Tool [+][+] System :: Uptime [+][+] StarCraft II Mouse Trap [+][/center] Link to comment Share on other sites More sharing options...
scriptjunkie Posted March 12, 2010 Share Posted March 12, 2010 That's kinda of a cool idea. I like the adding support to load a file to the clipboard. (even though I'm sure it's been done before). expandcollapse popup#cs ---------------------------------------------------------------------------- Author: -> Final Version Version: -> 3.3.5.6 <Beta> Function: -> Simple clipboard tool, but could potentially but useful for nurmerous people.s #ce ---------------------------------------------------------------------------- #include <Misc.au3> Opt("TrayMenuMode", 3) $tClear = TrayCreateItem("-> Clear The Clipboard") $tRead = TrayCreateItem("-> Read The Clipboard") $tReadfile = TrayCreateItem("-> Load File to Clipboard") $tExit = TrayCreateItem("-> Exit Program") While 1 $tMsg = TrayGetMsg() Select Case $tMsg = $tClear ClearTheClip() Case $tMsg = $tRead ReadTheClip() Case $tMsg = $tReadfile AddFileToClip() Case $tMsg = $tExit End() EndSelect If _IsPressed("11") And _IsPressed("24") Then ClearTheClip() ElseIf _IsPressed("11") And _IsPressed("21") Then ReadTheClip() ElseIf _IsPressed("11") And _IsPressed("23") Then End() ElseIf _IsPressed("11") And _IsPressed("22") Then AddFileToClip() EndIf WEnd Func ClearTheClip() ClipPut(""); EndFunc ;==>ClearTheClip Func ReadTheClip() $sRead = ClipGet(); If $sRead = "" Then TrayTip("Current Clip Contents", "Clipboard doesn't contain anything!", 3, 1); ElseIf $sRead = " " Then ;==> This is for my personal use, I got into the habit of clearing my clipboard by cutting a space in a text field. TrayTip("Current Clip Contents", "Clipboard contained a space, I'll empty it for you...", 3, 1); ClipPut("") Else TrayTip("Current Clip Contents", $sRead, 3, 1); EndIf EndFunc ;==>ReadTheClip Func AddFileToClip() Local $filename, $filehand, $filedata $filedata = "" $filename = FileOpenDialog("Choose file", "./", "All (*.*)", 1+2) If $filename = "" Then Return $filehand = FileOpen($filename, 0) If $filehand = -1 Then MsgBox(0, "Error", "Unable to open file.") Return EndIf While 1 $filedata = $filedata & FileRead($filehand, 1024) If @error = -1 Then ExitLoop Wend FileClose($filehand) ClipPut($filedata) TrayTip("Loaded into Clipboard", $filedata, 3, 1); EndFunc ;==>AddFileToClip Func End() Exit EndFunc ;==>End Link to comment Share on other sites More sharing options...
wraithdu Posted March 12, 2010 Share Posted March 12, 2010 _IsPressed in a loop like that is a bad hack. Why not just send the keypresses through in your function if you really don't want to eat them? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now