Script to reenable Trackpad zoom

Hi together,
We all know the bug when the trackpad suddenly stops allowing to zoom in/out or to use the smart zoom (here or here and here). And apparently toggling the "zoom in & out" function in the trackpad settings solves the problem for a while. So I made this apple Script as a temporal solution.

try
tell application "System Preferences"
	set current pane to pane "com.apple.preference.trackpad"
end tell

tell application "System Events"
		tell process "System Preferences"
			click radio button "Scroll & Zoom" of tab group 1 of window "Trackpad"
			click checkbox 2 of tab group 1 of window "Trackpad"
			click checkbox 3 of tab group 1 of window "Trackpad"
			click checkbox 2 of tab group 1 of window "Trackpad"
			click checkbox 3 of tab group 1 of window "Trackpad"
		end tell
	end tell
	tell application "System Preferences"
		quit
	end tell
end try

Just leave this Apple Script in an action you trigger when the problem appears and it should -hopefully- be fine. Couldn't test it though for now because (of course) the problem didn't appear since, but as it just does what I do normally I don't see any problems :man_shrugging:t2:
Just keep in mind that the script quits the System Preferences after…

Have a great day you all!
~Caliguvara

@Mio
@Hayden
@cubflyer
@yuuiko (as I saw in the comments that you have the same bug)

I guess you got it first :stuck_out_tongue:

I was going to make one that didn’t open the sysprefs window and just did it in the background every so often, but havent got up to it yet (and I don’t know if this is possible either)

1 Like

It should be, but probably rather with shell than Apple script, but I would have to dig deeper into it as I understand shell even less than Apple Script.. I'll try to figure out how this works after the exams in two weeks (damn I feel like I have them all the time), and if so post an update here. :slightly_smiling_face:

1 Like

If you feel adventurous you can try this terminal command with the latest alpha:

defaults write com.hegenberg.BetterTouchTool BTTAutomaticallyRefreshPinches YES

It should automatically bring back the pinches, but I'm not yet sure about any side effects

1 Like

Thanks for the reply but I've tried both, the apple script and the terminal command one, but neither have worked so far.

Yeah, I also discovered that sometimes it needs to be run twice, or you have to change the application, run it, and when you come back it works. :confused: Unfortunately this is the best I can offer for now.

1 Like

Do any of you happen to use the macOS app Magnet? It was the cause of this bizarre issue for me! I quit the app and pinch to zoom has been working without a hiccup ever since.

Thanks, this works for me! Could you tell us a little more about what this is actually doing as I'm concerned when I see the words "side effects". For instance, should one turn this back to "NO" after running with "YES"?

Are you able to describe what you use to detect the issue?

I found a way to re-set the System Preferences checkbox using a system call if you wanna check it out: Weird interaction makes trackpad's zoom not work

So I'm thinking of implementing some kind of background thing to run it periodically