Results 1 to 3 of 3

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Olympia, WA, USA
    Posts
    46

    Default Beyond Compare as Compare Tool in TextPad

    TextPad is my primary text editor. As with most text editors, it has it's own primitive compare tool. While there's no way to specify an external compare tool in TextPad, I did manage to put together something that's pretty darned close.

    I set up an external tool in TextPad, which is a CMD file and takes as a Parameter $File. The CMD file runs an AutoIt script.

    TextPad uses CTRL-F9 to compare the two most recently selected files. I use ALT-F9. Select File 1. ALT-F9. Select File 2. ALT-F9.

    Violets!

    CMD file

    Code:
    "C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "C:\Users\<username>\AppData\Roaming\Helios\TextPad\7\Tools\BeyondCompareQueue.au3" %1
    AutoIt script

    Code:
    #include <File.au3>
    
    Opt("MustDeclareVars", 1)	;0 = no, 1 = require pre-declare
    
    Local $Quote = chr(34)
    Local $InputFile = $CmdLine[1]
    
    Local $ClipboardContents = ClipGet()
    If FileExists($ClipboardContents) Then
    	If $InputFile = $ClipboardContents Then
    		Local $szDrive, $szDir, $szFName, $szExt
    		Local $TestPath = _PathSplit($ClipboardContents, $szDrive, $szDir, $szFName, $szExt)
    		MsgBox(4096, @ScriptName, "Attempt to compare " & $szFName & $szExt & " to itself")
    	Else
    ;		Local $Command = $Quote & "C:\Program Files (x86)\Beyond Compare 3\BCompare.exe" & $Quote & " " & $Quote & $ClipboardContents & $Quote & " " & $Quote & $InputFile & $Quote
    		Local $Command = $Quote & "C:\Program Files (x86)\Beyond Compare 4\BCompare.exe" & $Quote & " " & $Quote & $ClipboardContents & $Quote & " " & $Quote & $InputFile & $Quote
    		Run($Command)
    	EndIf
    Else
    	ClipPut($InputFile)
    EndIf
    Ken Grubb
    Olympia, WA

  2. #2

    Default

    Well that makes perfect sense. I use TextPad as well and I love its mark-line handling. I hope to get similar handling into BC3's File Viewer. And, we're working on syntax highlighting also.

  3. #3
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,788

    Default

    Thanks. I assume you mean a Find dialog which then marks all found entries? We do have this on our wishlist.

    And thanks for the script solution, Ken. That looks great!
    Aaron P Scooter Software

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •