I found this idea very interesting.
But wanted to be able to do this without the manual copy paste hassle.
Or more simply, wanted to be able to just open 2 files in Textpad and activate a visual file compare tool.
So I decided to write a script that accepts one filename as a command line paramenter from textpad as trids solution does. Then the script automatically activates textpad, goes to the next document, copies it's name to the clipboard, returns to the inital document, and finally launches my compare tool of choice with those two files as parameters
For scripting I used AutoIt
http://www.autoitscript.com/autoit3/
For comparing I used WinMerge
http://winmerge.sourceforge.net/
Both are open source.
My AutoIt script is as follows
Filename :
rundiff.au3
Code: Select all
Dim $runline
Dim $prgfile, $prgfolder
$prgfile = "WinMerge.exe /e"
$prgfolder = "WinMerge"
;$prgfile = "ExamDiff.exe"
;$prgfolder = "ExamDiff"
;$prgfile = "ExamDiff.exe"
;$prgfolder = "ExamDiff Pro"
If WinExists("TextPad") Then
WinActivate("TextPad", "") ;Activate Textpad
Send("^{TAB}") ;Go to next document
Send("!eyn") ;Copy filename to clipboard
Send("^{TAB}") ;Go back to original document
EndIf
Dim $leftfile = $CmdLine[1] ;Left filename from TextPad via command line parameter
Dim $rightfile = ClipGet() ;Right filename from TextPad via clipboard
$runline = @ProgramFilesDir & "\" & $prgfolder & "\" & $prgfile
$runline = $runline & " """ & $leftfile & """ """ & $rightfile & """"
Run($runline)
Then I used AutoIt conversion tool to create an exefile from the script named
rundiff.exe
Finally I configured a new Textpad tool as trids explains.
Except you browse to the
rundiff.exe file and leave the
Parameter = $File and delete
$FileDir from
Initial Folder to leave it blank.
And pling
Note that this displays the active document on the left and the next document on the right in WinMerge.
Regards, Lostclown
EDIT
Tested this with ExamDiff as well and modified the script to work for both.
To make this change you just have to uncomment the correct pair of $prgfile and $prgfolder variables at the top before compiling.
Although I didn't like the old freeware version of ExamDiff very much the Pro shareware version is much better and can easily be recommended.