In most OS X apps option-delete deletes the previous word plus any
whitespace after it. BBEdit does not do this (for whatever reason). I want
to create a very simple Applescript that does this. Here's what I've got so
far:
*tell* *application* "BBEdit"
*tell* *text* *of* *front* *text window* *to* *find* "(\S+)?([ \t]+)?"
options {search mode:grep, backwards:true} *with* selecting match
*end* *tell*
*
*
This, obviously, finds what I want to delete, but does not delete it. I've
tried hacking together key code events, and stubbled my way around the
replace functions, but I'm interested in doing it right. Can you help?
It might also be nice to be able to script the option-arrows to move the
insertion point in the same way the rest of the OS behaves. My first
thought was to do a search with a lookbehind (as a way of moving the
insertion point) but BBEdit doesn't seem to allow non-fixed-length
lookbehinds. Is this a Grep limitation? Is there a way around it?
I know Grep pretty well but I don't know anything about AppleScript.
--
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>