Sometimes you want to find and replace in selected text only. And after the replacement, you want the modified text to be selected again. E.g. because you want to run another Find/Replace action:
This macro is a first draft for that task. The checkboxes aren’t functional yet.
Suggestions are very welcome.
Find+Replace in Selection; Restore Selection Macro (v11.0.4)
Does the part of your macro that you wrote work? (If you had uploaded your macro, I could have checked if it works.) If it works, the only suggestion I have is that you can shorten your code a little bit by doing this:
It’s meant for all apps where I can edit text, for instance BBEdit, Safari, Airmail, CafeTran Espresso, etc.
For CafeTran Espresso I’ll have to investigate how the selection “collapses” when pasting text. If I remember correctly, the behavior is different from native macOS apps.
Thanks for your script, I’m sure that It’ll be of use one day.