Hello. I'm trying to create an action that will let me press a key combo with text selected (but not copied), and end up replacing that text with something that has been processed via regular expressions.
I've been using this: Find and Replace in Selected Text as a starting point, but have ran into some weird issues.
If I have it run a shell script that does a pbcopy, everything works fine.
I've tried adding in delays both in the shell script and in BTT between the actions, but to no avail.
Is there something special about an osascript call in a shell script that lets BTT continue to the next action, even though the shell script itself hasn't finished? Any thoughts?
Here's the script I'm testing with - just replaces all "a" with "b":