Skip to content

Instantly share code, notes, and snippets.

@codycodes
Last active September 24, 2020 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codycodes/2117cf0a9ac9ce640c90e5d95da7cf57 to your computer and use it in GitHub Desktop.
Save codycodes/2117cf0a9ac9ce640c90e5d95da7cf57 to your computer and use it in GitHub Desktop.
Automator Service which allows you to easily find/replace all occurrences of selected text via Python

Steps to setup:

  1. Download the file " universal_find_replace.zip" and unzip it (you can do unzip universal_find_replace.zip in the Terminal or right-click and decompress from the GUI.
  2. Click the Universal Find + Replace. and install it
  3. Set a keyboard shortcut to invoke it, or use the Services dropdown by right-clicking after selecting some text (see image below for the preference pane).

NOTE: Safari 14 broke the functionality to "Output replaces selected text"; therefore this script uses a workaround of copying the output to the clipboard. As of today, you'll then need to paste this back in on Safari 14; it will automatically replace the text in other apps. See this link for more info.

@codycodes
Copy link
Author

Setting a keyboard shortcut:

universal_find_replace_keyboard_shortcut

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment