Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Delete WebKit search fields (See related posts)


# defaults read com.apple.Safari | grep -i com.apple.WebKit.searchField:
# open $HOME/Library/Preferences/com.apple.Safari.plist
# put the following function into ~/.bash_login

function dws() { 

if [[ ! -e "$HOME/Library/Preferences/com.apple.Safari.plist" ]]; then
   printf "There is no com.apple.Safari.plist file in $HOME/Library/Preferences\x21\n"
   return 1
fi

defaults read com.apple.Safari | sed -En -e "s/^[[:space:]]*\"(com.apple.WebKit.searchField:.*)\" = .*$/\1/p" | while read item; do 
   #printf -- "$item\n"
   defaults delete com.apple.Safari "$item" 2>/dev/null
done

return 0

}     



You need to create an account or log in to post comments to this site.


Related Posts