On 7/8/13 at 11:47,
st...@shodgson.org.uk (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