Announcement

Collapse
No announcement yet.

Beyond Compare as Compare Tool in TextPad

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • kengrubb
    started a topic Beyond Compare as Compare Tool in TextPad

    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

  • Aaron
    replied
    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!

    Leave a comment:


  • taibasq
    replied
    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.

    Leave a comment:

Working...
X