Skip to content

Instantly share code, notes, and snippets.

@kerim
Created December 28, 2016 01:57
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kerim/d304348808833f9fea59a5598b62cc4a to your computer and use it in GitHub Desktop.
Save kerim/d304348808833f9fea59a5598b62cc4a to your computer and use it in GitHub Desktop.
AppleScript to find and replace text in file using TextWrangler
tell application "TextWrangler"
open theFile
replace "[FIND TEXT]" using "[REPLACE TEXT]" searching in text 1 of front document options {starting at top:false, wrap around:true, backwards:true, case sensitive:true, match words:true, extend selection:false}
replace "[FIND TEXT 2]" using "[REPLACE TEXT 2]" searching in text 1 of front document options {starting at top:false, wrap around:true, backwards:true, case sensitive:true, match words:true, extend selection:false}
tell front document
save
end tell
end tell
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment