This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Replace "search" with "replacement" in "input" (all text) | |
on replace_string(input, search, replacement) | |
set oldDelim to AppleScript's text item delimiters | |
set AppleScript's text item delimiters to search | |
set textItems to every text item of input | |
set AppleScript's text item delimiters to replacement | |
set res to textItems as string | |
set AppleScript's text item delimiters to oldDelim | |
return res |