Hi Allen,

I don't know if this is possible with BBEdit alone.
But you could do it in a terminal with the help of command line utilities 
diff <https://www.gnu.org/software/diffutils/> and aha 
<https://github.com/theZiz/aha>, generating a colored HTML file.

Install Diffutils and Aha:

    % brew install diffutils
    % brew install aha

Run this command in Teminal with your files:
    
    % diff -y --color=always ~/Desktop/A.txt ~/Desktop/B.txt | aha 
--stylesheet > ~/Desktop/output.html

Within BBEdit with a differences window in the foreground with the help of 
Applescript:

*tell* *application* "BBEdit"

   *if* *class* *of* *front* *window* = *differences window* *then*

       *set* vFileA *to* POSIX path *of* ((*file* *of* *first* *document* 
*of* *front* *window*) *as* *string*)

       *set* vFileB *to* POSIX path *of* ((*file* *of* *second* *document* 
*of* *front* *window*) *as* *string*)

       *set* vCommand *to* "/opt/homebrew/bin/diff -y --color=always" & 
space & *the* quoted form *of* vFileA & space & *the* quoted form *of* 
vFileB & space & "| /opt/homebrew/bin/aha --stylesheet > 
~/Desktop/output.html"

       *do shell script* (vCommand)

       *do shell script* "open ~/Desktop/output.html"

   *end* *if*

*end* *tell*


HTH


Jean Jourdain
On Monday, February 26, 2024 at 10:17:37 PM UTC+1 Allen Watson wrote:

> I love the ability to find the differences between two text files. I would 
> really like to have a printed version of the result, showing the 
>  differences, so that I could pass out a handout to students in my class. 
>
> Is it possible somehow to print the differences? Just printing only prints 
> the panel at the bottom, not the two side-by-side texts. A screen shot 
> seems to lose the highlighting that shows the differences.
>

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "[email protected]" rather than 
posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/df4999f3-ab42-4d8c-83fe-4fdf26ce7266n%40googlegroups.com.

Reply via email to