I have a simple AppleScript that calls a perl shell script to replace a string with another string (here one with two) in files with specified file extensions (here .txt and .xyz). It used to work exactly as I have it below, but no longer does (possibly since updating to Mojave last year). set CleanFiles to " s/one/two/g; " set myFolder to choose folder with prompt "Choose a folder with files to be cleaned up:" set theFolder to POSIX path of myFolder do shell script "find " & theFolder & " \\( -name \\*.txt -o -name \\*.xyz \\) -print0 | xargs -0 perl -i -pe '" & CleanFiles & "'" There is no error message, it seems to run but doesn't do anything. What could be wrong?