Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Apple Script to Comment Lines in Text Wranger/BBEdit


From   Steven Samuels <sjhsamuels@earthlink.net>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Apple Script to Comment Lines in Text Wranger/BBEdit
Date   Sun, 28 Sep 2008 20:59:13 -0400

Thanks to John Gardner, an improved version of the script is available at:
http://dataninja.wordpress.com/2008/09/27/unified-generic- commentuncomment-scripts/

The new script happily borrows techniques from John's original Comment and Uncomment scripts (http://dataninja.wordpress.com/ 2006/05/08/textwrangler-uncomment-scripts-for-stata/).
It is a) faster and b) "generic", in that it will recognize other languages. R and LaTex are currently included and it is easy to add more.

The script determines if the first character of a selection starts a comment or not; if not, a comment is added to every line of the selection; if not, a comment present at the start of a line is deleted.

Note that "comment" here means "// " (space following the slashes)

Other points.
--To add comments, start the selection in a line that is not commented.
--To delete comments, start the selection with a commented line.
--If nothing is selected, the script will comment or uncomment the current line.

-Steve
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index