Here is the script I use for this purpose:

*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

To install: name the script "Document.documentDidOpen.scpt" and put it in 
"~Library/Application Support/BBEdit/Attachment Scripts"
Some kind person at BareBones tech support gave this to me (unfortunately I 
can't find the email to give proper credit); I made a few tweaks.

-- Russell

On Tuesday, October 23, 2012 4:16:28 PM UTC-7, Drew Schatt wrote:
>
> 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
>

-- 
-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
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>



Reply via email to