Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Warn when file type is NOT unix (or Mac)?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Drew Schatt  
View profile  
 More options Oct 23 2012, 7:16 pm
From: Drew Schatt <dsch...@fonality.com>
Date: Tue, 23 Oct 2012 16:16:28 -0700 (PDT)
Local: Tues, Oct 23 2012 7:16 pm
Subject: Warn when file type is NOT unix (or Mac)?

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 must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Christopher Stone  
View profile  
 More options Oct 23 2012, 8:33 pm
From: Christopher Stone <listmeis...@suddenlink.net>
Date: Tue, 23 Oct 2012 19:33:33 -0500
Local: Tues, Oct 23 2012 8:33 pm
Subject: Re: Warn when file type is NOT unix (or Mac)?
On Oct 23, 2012, at 18:16, Drew Schatt <dsch...@fonality.com> wrote:
> Is there any way to configure BBEdit to warn when the file type is NOT the default?

______________________________________________________________________

Hey Drew,

I don't believe there's a built-in method, but BBEdit is attachable - so it should be possible to script this.

Look in the manual under "Attaching Scripts to Menu Items".

--
Best Regards,
Chris


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rich Siegel  
View profile  
 More options Oct 23 2012, 8:50 pm
From: Rich Siegel <sie...@barebones.com>
Date: Tue, 23 Oct 2012 20:50:43 -0400
Local: Tues, Oct 23 2012 8:50 pm
Subject: Re: Warn when file type is NOT unix (or Mac)?
On Tuesday, October 23, 2012, Christopher Stone

<listmeis...@suddenlink.net> wrote:
>I don't believe there's a built-in method, but BBEdit is attachable -
>so it should be possible to script this.

>Look in the manual under "Attaching Scripts to Menu Items".

In this case I would actually recommend using a script
attachment point, rather than trying to hook on to a menu item;
you'll get better behavior.

Enjoy,

R.
--
Rich Siegel                                 Bare Bones Software, Inc.
<sie...@barebones.com>                      <http://www.barebones.com/>

Someday I'll look back on all this and laugh... until they
sedate me.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Delacour  
View profile  
 More options Oct 24 2012, 11:17 am
From: John Delacour <johndelac...@gmail.com>
Date: Wed, 24 Oct 2012 16:17:20 +0100
Local: Wed, Oct 24 2012 11:17 am
Subject: Re: Warn when file type is NOT unix (or Mac)?
On 24/10/2012 01:50, Rich Siegel wrote:

> In this case I would actually recommend using a script attachment
> point, rather than trying to hook on to a menu item; you'll get better
> behavior.

Rich,

Could you please post a working example of Document.scpt containing the
two handlers
documentShouldSave and documentWillSave.

I have tried to follow the instructions given in the manual and am
clearly missing something, since nothing happens.

JD


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Christopher Stone  
View profile  
 More options Oct 25 2012, 2:59 am
From: Christopher Stone <listmeis...@suddenlink.net>
Date: Thu, 25 Oct 2012 01:55:48 -0500
Local: Thurs, Oct 25 2012 2:55 am
Subject: Re: Warn when file type is NOT unix (or Mac)?

On Oct 24, 2012, at 10:17, John Delacour <johndelac...@gmail.com> wrote:

> Could you please post a working example of Document.scpt containing the two handlers
> documentShouldSave and documentWillSave.

______________________________________________________________________

Hey John,

using terms from application "BBEdit"
  on documentShouldSave()
    beep
  end documentShouldSave
  on documentWillSave()
    beep
  end documentWillSave
  on documentDidSave()
    beep
  end documentDidSave
end using terms from

Using the same handler-set:

~/Library/Application Support/BBEdit/Attachment Scripts/Document.scpt

Beeps 3 times on Cmd-S or 'Save' menu selection.

~/Library/Application Support/BBEdit/Attachment Scripts/Document.documentDidSave.scpt

Beeps 1 time on Cmd-S or 'Save' menu selection.

Using BBEdit 10.5 (3221).

The attachment was live - i.e I did not have to restart BBEdit for it to start working.

--
Take Care,
Chris


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
rowen  
View profile  
 More options Oct 31 2012, 1:28 pm
From: rowen <ro...@uw.edu>
Date: Wed, 31 Oct 2012 10:28:55 -0700 (PDT)
Local: Wed, Oct 31 2012 1:28 pm
Subject: Re: Warn when file type is NOT unix (or Mac)?

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »