--Open and activate System Preferences
tell application "System Preferences" to activate
--Attempt to change settings using System Events
tell application "System Events"
tell process "System Preferences"
try
--Open the "Keyboard & Mouse" pane
click menu item "Keyboard & Mouse" of menu "View" of menu bar 1
--Now set the option. The delays prevent actions being sent before previous ones have been completed
delay 2
tell tab group of window "Keyboard & Mouse"
click radio button "Trackpad"
delay 2
end tell
if (the value of checkbox "Ignore accidental trackpad input" of group 1 of tab group 1 of window "Keyboard & Mouse") is 0 then
click checkbox "Ignore accidental trackpad input" of group 1 of tab group 1 of window "Keyboard & Mouse"
end if
on error theError
--An error occured
display dialog ("Sorry, an error occured while altering Keyboard and Mouse settings:" & return & theError) buttons "OK" default button "OK"
end try
end tell
end tell
delay 1
tell application "System Preferences" to quit