Speak Items Under the Pointer

By 3AM, 3 October, 2018

Forum
Low Vision Accessibility on Apple Products

Is there a way to create a keyboard shortcut to toggle “Speak items under the pointer” in System Preferences/Accessibility/Zoom? As a partially sighted user I very often use a screen reader to read aloud text elements throughout MacOS.

Until now I’ve been using a wonderful little app called GhostReader 1.6.9 which has that feature. With GR I can have anything read out loud with any installed voice with a simple key press of Control+Option when hovering over text. This has made a HUGE difference for me in terms of productivity. But Mojave states this is the last version GR will operate on. This worries me terribly!

I don’t use VoiceOver because it is just not ideal for partially sighted users like myself. I only need text read out when I need it, which is 80%+. Text to speech plus Full Screen Zoom is all I’ve needed until now.

So since the “Speak items under the pointer” is in fact an option within System Preferences/Accessibility/Zoom, I am hoping there is a way to make a simple keyboard shortcut to toggle it on/off.

For instance, with Dark Mode I have found a very simple Automator AppleScript that allows me to add a keyboard shortcut within System Preferences/Keyboard/Shortcuts/Services. If it is possible to do so with the Dark Mode feature, it must be possible with Speak items under the pointer as well.

Any help with this issue would be extremely appreciated!

Options

Comments

By Remy on Saturday, October 27, 2018 - 02:47

I have not used a mac in quite a while and I do tend to use screenreaders a tiny bit more than you do. But the feature you're talking about is one I use on both Mac and PC. I know with some screen readers you can choose which items Voiceover actually reads. I'm not sure what Voiceover's capabilities might be in that case. But it might be worth checking in its settings. Or you could just wait until someone with something more helpful to contribute comes along. :)

By SoYoung on Monday, February 27, 2023 - 02:47

I now its a very old topic, but I'm searching for the exact thing and I didn't find anything about it. The steak text under pointer works great on mac, but not being able to turn on/off with a keyboard shortcut is a huge inconvenience for productivity and prevents me to use it.

So, is there a way to create a specific keyboard shortcut just for this ? Thanks.

By 3AM on Monday, February 27, 2023 - 02:47

@SoYoung; I'm surprised more low vision users aren't crying out to Apple for this simple but extremely useful feature.

Though Apple has resisted, there is a current workaround to toggle this feature, though not intuitive to set up.

After reaching out to the Freelance.com developer community, I finally broke down and paid a developer for an AppleScript that does exactly what we need, a script to toggle "Speak item under the pointer."

Here is how I've implemented it.

First determine which MacOS version you are on.

==>> AppleScript for MacOS Ventura 13 or later ==>>
do shell script "open -b com.apple.systempreferences " & ¬
"/System/Library/PreferencePanes/UniversalAccessPref.prefPane"

tell application "System Events"
tell its application process "System Settings"
repeat until UI element 4 of group 1 of scroll area 1 of group 1 of ¬
group 2 of splitter group 1 of group 1 of window "Accessibility" exists
delay 0.1
end repeat
click UI element 4 of group 1 of scroll area 1 of group 1 of group 2 ¬
of splitter group 1 of group 1 of window "Accessibility"
repeat until checkbox 3 of group 2 of scroll area 1 of group 1 of group ¬
2 of splitter group 1 of group 1 of window "Spoken Content" exists
delay 0.1
end repeat
click checkbox 3 of group 2 of scroll area 1 of group 1 ¬
of group 2 of splitter group 1 of group 1 of window "Spoken Content"
end tell
end tell

tell application "System Settings" to quit
<<== End of Script <<==

==>> for MacOS versions prior to Ventura ==>>
tell application "System Preferences"
reveal anchor "TextToSpeech" of pane id "com.apple.preference.universalaccess"
end tell

tell application "System Events" to tell process "System Preferences"
repeat while not (exists of checkbox "Speak items under the pointer" of group 1 of window "Accessibility")
delay 0.01
end repeat
set theCheckbox to checkbox "Speak items under the pointer" of group 1 of window "Accessibility"
tell theCheckbox
# If the checkbox is not checked, check it to turn speech on
if not (its value as boolean) then
set checked to true
click theCheckbox
else # else turn speech off
set checked to false
click theCheckbox
end if
end tell
end tell

tell application "System Preferences"
quit
end tell
<<== End of Script <<==

How to use:
1. I use an app called "BetterTouchTool" to create custom shortcut macros to trigger, in this case applescripts. (https://folivora.ai)
2. I then Crete and assign my desired trigger action to toggle the script. I personally use two methods.
- keyboard: CTRL+Z
- trackpad: swipe left with 3 fingers

Though it is not as ideal as Apple's accessibility keyboard shortcuts in System Settings>Keyboard>Keyboard Shortcuts, it does work for me.
It is not instant. It takes about 1 second to toggle. But it is much quicker and far easier than the alternative.

You may find other methods for running applescripts. If anyone finds a better way please post here.

I hope this helps...

By SoYoung on Monday, February 27, 2023 - 02:47

Thanks a lot for your answer, it is really helpful. However, my knowledge with macOS isn't as heavy. I don't really know how to add Applescripts to begin with, or being comfortable to add one without messing anything. Can you explain how to add an Applescript? I see you explained how to add a shortcut for a script, but not how to add a script itself. Thanks a lot.

By PaulMartz on Monday, February 27, 2023 - 02:47

My suggestion is to turn on VoiceOver and press VO+F5 (control+option+F5).

The nice thing about VoiceOver on the Mac is that turning it on doesn't change the entire user interface (like it does on iOS). While VoiceOver is on, continue using your Mac with a mouse as if VoiceOver is off. I did this for years as my eyesight degraded and I slowly went from sighted to low vision to completely blind.

By 3AM on Monday, February 27, 2023 - 02:47

@PaulMartz
Thanks so much for your tip. However, if VO wasn't so buggy, and if there were simple shortcut keys to mute VO, I would also recommend VO.
But due to the lag in toggling VO on and off, and the cumbersome way to mute speech, the best alternative right now is using the Speak item under the pointer in Spoken Content.

@SoYoung
Here is how I use the AppleScript using BetterTouchTool (well worth the money IMHO)
1. create new keyboard shortcut.
2. in the "Click here to record a shortcut" window, perform the shortcut combination you desire to use to toggle the feature. (I use fn+Z.)
3. Click the + under the Assign First Action to Selected Trigger."
4. In the search field to the right, type "AppleScript" and select "Run Apple Script (blocking"
5. Paste the desired AppleScript in the window which now appears.
*For Ventura or later use the following. (See above for earlier MacOS versions)
6. Now click "Run Script" to execute the AppleScript for the first time. (Note: It may ask for you to grant security access. Simply accept and proceed.)

If you were successful, you will notice System Settings quickly opens and closes. This is needed due to the fact that this script simply performs the steps to open the preference pane and toggles the feature on or off.)

Congratulations. You should now have your own keyboard shortcut to toggle Speak item under the pointer.

Apple could have made our lives much easier by offering user assignable shurttcuts. But no!

Again, I pray this is helpful to you or anyone else.

By Jonathan Shopiro on Monday, February 27, 2023 - 02:47

I already had LaunchBar, which I have been using for years. I copied the Ventura version of the script into Script Editor and compiled it (took some fiddling with line endings). Then I exported it as a script (it does not work if you export it as an Application). Then I added it to LaunchBar's Index in Custom Lists. All done.

By 3AM on Monday, February 27, 2023 - 02:47

@Jonathan Shapiro
I'm not familiar with LaunchBar. But I am glad the Ventura code worked as desired. Thanks for the update!

By 3AM on Friday, October 27, 2023 - 02:47

Hello all,
I want to share an amazing update.
We all know how challenging it generally is to get Apple Accessibility to listen to the low vision community with suggestions and feedback.
But I would love to report that, after many attempts for a user assignable shortcut, Apple has, in THIS case, responded!
So now, simply head to MacOS Settings/Keyboards/Keyboard Shortcuts, you'll now find a few new shortcut options you can easily toggle by assigning your own key combination.
I personally use BetterTouchTool to link a trackpad gesture to any key combination to be able to effortlessly toggle this and other options.
THANK YOU APPLE for FINALLY LISTENING to us on this item.
Now would you PLEASE focus on the other very challenging bugs we still face?
Hope this helps!
Be blessed all...