On Oct 12, 2016, at 10:15, Johan Sölve <johan.so...@gmail.com 
<mailto:johan.so...@gmail.com>> wrote:
> Since I work in the middle of an ongoing indentation war (you know, tabs vs. 
> spaces) I have a need for auto-detecting the indentation mode when opening …
> I'm not even sure if it's possible to hook a script into opening files, no 
> matter how a file was opened.

Hey Johan,

Look for “Document attachment points” in the BBEdit manual and 

You'll want your script to take this general form:

using terms from application "BBEdit"
   on documentDidOpen()
   end documentDidOpen
end using terms from

With a file-name like this: Document.documentDidOpen.scpt

I may have discovered a bug with this and have a query in to support.


I've done stuff like this before and don't really recommend it as an automated 
process.  I've had too many instances where something fairly critical got 
changed unexpectedly.

It's easy enough to create a keyboard shortcut driven script to do this.

Generally I use tabs anyway and detab if needed.

But of course YMMV.

Best Regards,

This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" 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 bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.

Reply via email to