On Thu, 21 Sep 2006 21:42:05 +0100, Johan Solve wrote
(in message <[EMAIL PROTECTED]>):
> You can attach a script to any menu item in BBEdit.
>
> Save this script with the name File*Save (that's a bullet character in the
> middle) in the folder Menu Scripts, and it will fix this automatically for
> you at every save.
>
> using terms from application "BBEdit" -- only needed to make the script
> compile
> -- no "tell" needed since script is executed inside of BBEdit
> on menuselect(menu_name, item_name)
> if (count of text windows) > 0 then -- and class of document 1
> is text
> window then
> tell text window 1
> set replacecount to (replace "\s+\z" using ""
> options {starting at
> top:true, search mode:grep})
> end tell
> end if
> return false -- BBEdit continues with the command
> end menuselect
> end using terms from
Hi
I just tried this AppleScript out because I'm interested in creating
find/replace scripts with for regular GREP find/replace things I do.
The script won't compile for me, it complains when it gets to:
replace "\s+\z"
selects the s and gives a dialogue:
Expected """ but found unknown token.
So, I wonder if the \ after the " is causing a problem?
I've put together a literal find/replace as a test and it works fine.
--
Patrick
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to: <[EMAIL PROTECTED]>