HI!
I'm not familiar with scripting, so please forget me if the question is too
basic or out of scope.
I would need to learn how to automate a simple search-replace (eventually
with greps) grep that would run only on the selected text of the front
BBEdit window.
The idea is to trigger the find-replace with a keyboard shortcut.
I guess it could be done with Applescript, something like:
*tell* *application* "BBEdit"
*tell* *front* *text window's* *text*
*set* _selection *to* contents *of* selection
* set* newText *to* "(here the grep "find" and "replace"
patterns, in this case "<p" and "somethingelse <p" )
* set* *text* *of* selection *to* newText
* end tell*
*end tell*
Could someone give me a hand with this?
Any ideas would be much appreciated.
Thanks for your time.
Pablo
PS: i'm attaching a screen capture of the search itself, not a grep in this
case.
[image: Captura de pantalla 2020-06-23 a las 12.31.49.png]
CCd
--
This is the BBEdit Talk public discussion group. If you have a feature request
or need technical support, please email "[email protected]" rather than
posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/bbedit/814c02c2-ad1b-4941-beda-90cff36c321fo%40googlegroups.com.