Could you please post a working example of Document.scpt containing the two handlers
documentShouldSave and documentWillSave.
on documentDidOpen(myDoc)
tell application "BBEdit"
if class of myDoc is not text document then
return
end if
if line breaks of myDoc = Unix then
return
end if
if line breaks of myDoc = Mac then
set lineBreakName to "old style Mac"
else
set lineBreakName to "Windows"
end if
set fn to name of myDoc
set lineEndingDialog to display dialog "File \"" & fn & "\" has " & lineBreakName & " line endings" buttons {"Convert to Unix", "Preserve"} default button 1
set answer to button returned of lineEndingDialog
if answer = "Convert to Unix" then
set properties of text document 1 to {line breaks:Unix}
end if
end tell
end documentDidOpen
Is there any way to configure BBEdit to warn when the file type is NOT the default? I typically use Unix (LF) as my file type, and I'd find it helpful if BBEdit would warn me when I'm saving a file that has Windows linebreaks instead.Is there some option that I'm missing?-Drew