At 03:35 -0700 23/07/2011, Albert Frantz wrote:
I'm brand new to BBEdit (love it!) and am trying to write a simple
search and replace script. For now, I'm just trying to get it to find
and replace "</p><p>" with two carriage returns.
The following AppleScript compiles but it doesn't actually do
anything:
tell application "BBEdit"
tell text of front text window
replace "</p><p>" using "\\r\\r"
end tell
end tell
There does seem to be something flaky here. Some things I tried
worked and others didn't. Try this:
tell application "BBEdit"
activate
set _doc to make document with properties ¬
{contents:"<p>a</p><p>b</p><p>c</p>"}
replace "</p><p>" using "\\r\\r" searching in _doc
end tell
Eventually I'd like to get it to replace text in all open windows.
Simple:
replace "</p><p>" using "\\r\\r" searching in every document
JD
--
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>