zfisherdrums Posted January 10, 2009 Share Posted January 10, 2009 All,With regard to coding, scripting, etc - cut-and-paste is a sin. At least it is to me. And some others as well. Even so, I do what I should not do.I ran into a scenario where I needed to confirm if two areas of text were the same. Furthermore, the text was in the same document, so WinMerge, DiffDoc, BeyondCompare were out. It occurred to me that this quick and dirty script may be useful if one needs to compare areas of text that are too large to confirm quickly. Behold the fruits of 12 days of laborious scripting activity*!HotKeySet( "^!{LEFT}", "StoreClipboardContentsA" ) HotKeySet( "^!{RIGHT}", "StoreClipboardContentsB" ) HotKeySet( "^!{DOWN}", "CompareContents" ) Global $g_sClipboardA = "" Global $g_sClipboardB = "" While 1 Sleep( 250 ) Wend Func StoreClipboardContentsA() Send( "^c" ) $g_sClipboardA = ClipGet() SoundPlay(@WindowsDir & "\media\ding.wav",1) EndFunc Func StoreClipboardContentsB() Send( "^c" ) $g_sClipboardB = ClipGet() SoundPlay(@WindowsDir & "\media\ding.wav",1) EndFunc Func CompareContents() If $g_sClipboardA == $g_sClipboardB Then MsgBox(0, @ScriptName, "Compared contents are the same" ) Else MsgBox(48, @ScriptName, "Compared contents are different" ) EndIf EndFunc* 12 metric days = 5 minutes.Ctrl+Alt+Left stores clipboard contents into "A".Ctrl+Alt+Right stores clipboard contents into "B".Ctrl+Alt+Down does a case-sensitive comparison. Identify .NET controls by their design time namesLazyReader© could have read all this for you. Unit Testing for AutoItFolder WatcherWord Doc ComparisonThis here blog... Link to comment Share on other sites More sharing options...
Andreik Posted January 10, 2009 Share Posted January 10, 2009 (edited) If exists the differences it would be very nice to show them. Anyway, simple and easy to use. EDIT: and write a function to exit from program Edited January 10, 2009 by Andreik When the words fail... music speaks. Link to comment Share on other sites More sharing options...
zfisherdrums Posted January 10, 2009 Author Share Posted January 10, 2009 (edited) If exists the differences it would be very nice to show them. Anyway, simple and easy to use. EDIT: and write a function to exit from program Thanks for the feedback!With regards to what diff'd, I only wanted to confirm that a diff exists. And as far as an exit function is concerned, I was more than happy with the tray icon's Exit function. Zach Fisher.... Edited January 11, 2009 by zfisherdrums Identify .NET controls by their design time namesLazyReader© could have read all this for you. Unit Testing for AutoItFolder WatcherWord Doc ComparisonThis here blog... 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