On Nov 04, 2011, at 15:09, Oliver Taylor wrote: > 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: ______________________________________________________________________
Hey Oliver, tell application "BBEdit" tell text of front text window set fRec to find "[ \\t]*\\S+[ \\t]*" options {search mode:grep, backwards:true} if found of fRec = true then delete text of found object of fRec end if end tell end tell I've changed this a bit to delete any whitespace to the left of the cursor + any contiguous non-whitespace + any remaining whitespace. As you can see it only deletes if something is found, and it deletes the text of the found-object directly. -- 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 bbedit@googlegroups.com To unsubscribe from this group, send email to bbedit+unsubscr...@googlegroups.com 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 "supp...@barebones.com" rather than posting to the group. Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>