Preferences changes using "defaults" not applied
The preference you wish to set is saved in ~/Library/Preferences/ByHost, so you have to add the switch -currentHost to the defaults command

Try the following code with Value set to 0, then set to 2 and see the difference

Value="0"; \
echo "before"; \
: read actual values; \
defaults -currentHost read -g "com.apple.trackpad.threeFingerTapGesture"; \
defaults read com.apple.AppleMultitouchTrackpad TrackpadThreeFingerTapGesture; \
: close System Preferenes; \
pkill -u "${USER}" \
      -f "^/Applications/System Preferences.app/Contents/MacOS/System Preferences$" 2&gt;/dev/null; \
: set value in ~/Library/Preferences/ByHost/.GlobalPreferences.#Hardware UUID#.plist; \
: where your hardware uuid can be determined with; \
: ioreg -c IOPlatformExpertDevice  -d 2 | awk -F'"' '/IOPlatformUUID/ { print $(NF-1) }'; \
defaults -currentHost write -g "com.apple.trackpad.threeFingerTapGesture" -integer ${Value}; \
: set value in ~/Library/Preferences/.GlobalPreferences.plist; \
defaults write com.apple.AppleMultitouchTrackpad TrackpadThreeFingerTapGesture -integer ${Value}; \
: kill the preference cache process; \
pkill -u "${USER}" -l "^/usr/sbin/cfprefsd agent$" 2&gt;/dev/null; \
: wait a second otherwise you get errors on the defaults commands; \
sleep 1; \
echo "after"; \
: read set values; \
defaults -currentHost read -g "com.apple.trackpad.threeFingerTapGesture"; \
defaults read com.apple.AppleMultitouchTrackpad TrackpadThreeFingerTapGesture; \
: open trackpad preference; \
open "/System/Library/PreferencePanes/Trackpad.prefPane"


gives me

before
2
2
after
0
0


regards

Gerd