Skip to content

Instantly share code, notes, and snippets.

@luckman212
Last active October 13, 2022 05:00
Show Gist options
  • Save luckman212/6bc9fd441f235ea0e4e9d19792bb5449 to your computer and use it in GitHub Desktop.
Save luckman212/6bc9fd441f235ea0e4e9d19792bb5449 to your computer and use it in GitHub Desktop.
Possible fix for iMessage text mangling
#!/usr/bin/env bash
# ref:
# https://forums.macrumors.com/threads/smart-quotes-forced-on-in-messages.2284346/post-30657259
_res() {
(( res += $1 ))
}
res=0
dom1=com.apple.iChat.inputLine
dom2=com.apple.messages.text
plutil -convert xml1 ~/Library/Preferences/${dom1}.plist -o - |
sed 's#<true/>#<false/>#' |
defaults import $dom1 -
_res $?
for k in EmojiReplacement SmartDashes SmartInsertDelete SmartQuotes; do
defaults write $dom2 $k -bool True
_res $?
done
killall cfprefsd
_res $?
[[ $res -eq 0 ]] && echo "success"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment