On Aug 21, 2012, at 06:32, Pierre Igot <[email protected]> wrote:
> I have other, simpler scripts that sort of work for this, but the grep-based 
> approach is obviously the most effective. If only I could make it work...
______________________________________________________________________

Hey Pierre,

It looks to me like you've exposed a bug.  I've got a query in to support, so 
we'll see.

In the meantime this rather quick and dirty script works.

------------------------------------------------------------------------------------------------
try
  
  tell application "BBEdit"
    tell text of front text window
      set endMarker to (characterOffset of selection) + (length of selection) - 
1
      set fRec to find "[^\\r]+" options {search mode:grep, starting at 
top:false, wrap around:false, backwards:true, case sensitive:false, match 
words:false, extend selection:true} with selecting match
      set foundObject to found object of fRec
      properties of foundObject
      set startmarker to characterOffset of foundObject
      select (characters startmarker thru endMarker)
    end tell
  end tell
  
on error eMsg number eNum
  set {c, s} to {return, "------------------------------------------"}
  set e to s & c & "Error: " & eMsg & c & s & c & "Error Number: " & eNum & c & 
s
  beep
  set dDlg to display dialog e buttons {"Cancel", "Copy", "OK"} default button 
"OK"
  if button returned of dDlg = "Copy" then
    set the clipboard to e
  end if
end try
------------------------------------------------------------------------------------------------

--
Best Regards,
Chris

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