Hey Shiran,

On Jun 18, 2012, at 10:46, Gingi wrote:
> That does the trick. I was just hoping there would be a way to set this 
> universally.

File a feature request with support: [email protected], and be sure to make 
your case.  A really well thought out argument is much more likely to be 
accepted than "I want this feature…".

> I use several languages with different comment characters so scripting all of 
> them can become a hassle.


No hassle.  Just allow for the different languages (see appended script).

> Then again, I should get comfortable with BBEdit scripting.

Yes.  :)

You can't always make BBEdit do exactly what you want, but the possibility-pool 
grows exponentially.

Note: the script can be changed such that if there is no selection the current 
line becomes the target.  This kind of action is very flexible.

--
Best Regards,
Chris

------------------------------------------------------------------------------------------------
tell application "BBEdit"
  tell front text window
    
    set srcLang to source language
    
    if srcLang = "HTML" then
      set quoteStr to "<!--"
    else
      set quoteStr to "//"
    end if
    
    tell selection
      replace "^([ \\t]*)(.+)" using ("\\1" & quoteStr & " \\2") options 
{search mode:grep, case sensitive:false}
    end tell
    
  end tell
end tell
------------------------------------------------------------------------------------------------

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem, 
please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

Reply via email to