On 2007-03-04, at 18:14.0, David Gilden wrote:

I am trying to write a script that will comment and uncomment a block of code
i.e.

For commenting a selection, you can do this:

tell application "BBEdit"
        tell front window
                set s to selection
                set selection to "/*" & return & selection & return & "*/"
        end tell
end tell

For decommenting a selection, you have various possibilities. You could try something like this:

tell application "BBEdit"
        tell front window
                set s to contents of selection
                replace "/*" using ""
                replace "*/" using ""
        end tell
end tell

but there are some things that could go wrong here... :-)


--
------------------------------------------------------------------
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