On 7/8/13 at 11:47, [email protected] (Steve Hodgson) wrote:

Normalize Line Breaks appears to fix this using the format of the
first line break rather than the line break preference set in the
prefs.

Yes, that does work, but you have the extra step of manually changing the line endings to lf in the pop-up menu afterwards. For example, if you run the script below you will get a document which gives a ¿ for the Mac line endings instead of a new line. Running “Text::Normalize Line Endings” will change these to Windows line endings.

#!/usr/bin/perl
use strict;
my $f = "/tmp/test_line_endings.txt";
open my $fh, ">$f" or die $!;
print $fh "§\015\012§\015§\012§\012§\015§\015\012§";
close $fh;
`open -a bbedit $f`;

You can do the whole thing in one go with an AppleScript script and optional key shortcut:

tell application "BBEdit"
    tell front document
        normalize line endings
        set line breaks to Unix
    end tell
end tell

JD



--
This is the BBEdit Talk public discussion group. If you have a feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.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 post to this group, send email to [email protected].


Reply via email to