On Mar 27, 2007, at 10:54 AM, Steve Kalkwarf wrote:

If you have a limited number of languages you want to switch among, you could use AppleScript, and apply a key shortcut to it:

tell application "BBEdit"
set source language of text window 1 to "Apache Configuration File"
end tell

Here's a script I use to switch among the set of languages I use most regularly. I have it bound to control-L.

tell application "BBEdit"
        try
                set cur_lang to source language of first window
                
set desired_lang to choose from list {"PHP", "HTML", "Markdown", "CSS", "Perl", "XML", "VBScript", "(none)", "(automatic)"} with prompt "Select document language" with title "Choose Language" default items {cur_lang} with empty selection allowed without multiple selections allowed
                
                set source language of first window to desired_lang
                
        on error
                display dialog "There is no window"
        end try
end tell

Joe
--
Joe Chellman
http://www.chellman.org/
http://www.chellman.org/pgp_key.txt


--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <[EMAIL PROTECTED]>

Reply via email to