Trackpad Zoom Fix with AppleScript

Sometimes the trackpad zoom just stops working. I have to go to System Preferences - Trackpad to uncheck and recheck the zoom feature.


I wrote this script automation (JavaScript) to do that automatically. I attached this to a BetterTouchTool gesture (fn + pinch in) to quickly fix this when zooming fails me.


Hope this issue gets fixed soon.


sp = Application("System Preferences")
pane = Application("System Preferences").panes.byId("com.apple.preference.trackpad")
sp.reveal(pane)

paneContent = Application("System Events").applicationProcesses.byName("System Preferences").windows.byName("Trackpad").tabGroups.at(0)

paneContent.radioButtons.byName("Scroll & Zoom").click()

checkbox = paneContent.checkboxes.at(1)

if (checkbox.value()) {
	checkbox.click()
}

checkbox.click()

sp.quit()

MacBook Pro with Touch Bar

Posted on May 6, 2019 4:04 AM

Reply

Similar questions

1 reply

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Trackpad Zoom Fix with AppleScript

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.