Speed Up Everyday Tasks on your Mac by Using the VoiceOver Keyboard Commander

Submitted by AppleVis on Wednesday, August 3, 2016

In this podcast, Mike Malarsie shows us how to access and use the VoiceOver Keyboard Commander, a nifty feature for Mac users which allows you to create and use custom keyboard shortcuts to speed up a number of tasks - such as open applications, files and folders; navigate and control what’s on screen; run Apple Scripts and Automator Workflows; issue VoiceOver commands; and much more.

If you have any commands that you find particularly useful, do please share them in the comments.

Podcast File

Options

Comments

Submitted by Ekaj on Wednesday, August 3, 2016

I use Keyboard Commander all the time now, and find it to be a big time saver. I have suggested to a sister of mine that she use it, but I don't think she has thus far. This sister is also a VoiceOver user. Besides Mail, Safari, and checking date and time, I have a command for TextEdit and more recently iTunes. I'm going to set up one for MarsEdit, since I just purchased the full version. In the coming months I will add others. Thanks for this.

Submitted by Becca on Wednesday, August 3, 2016

This is very cool! I never knew about this. Will be definitely be using this. Thanks.

Submitted by Carlos Taylor on Thursday, August 4, 2016

I set up keyboard commander to run an apple script that announces the battery level on my MacBook Air. I find it much faster to press a command, option b in my case, to hear the battery level rather than going through the menus to find the battery status. I found the scripts on Bryan Smart's web site. Here is the URl.
https://blog.bryansmart.com/2014/07/24/some-scripts-for-voiceover/
I also set up a keyboard commander key to launch text edit for those times when I need to access a word processor to take down a quick note such as a phone number or email address.

Submitted by Becca on Monday, October 14, 2019

Hi. I am trying to create a custom command to announce the battery status. I am not sure how to edit this using AppleScript.

Submitted by Oliver Kennett on Monday, October 14, 2019

Currently there is a problem with the VoiceOver keyboard commander running scripts. Apple accessibility are aware of the issue and are working on it.

If scripts are not working as expected the work around I use is to save a copy of the script as an app, choosing it from the file type dropdown when saving, and running that instead.

The one I use goes a little something like this:

on trim(someText)
repeat until someText does not start with " "
set someText to text 2 thru -1 of someText
end repeat
repeat until someText does not end with " "
set someText to text 1 thru -2 of someText
end repeat
return someText
end trim

set message to ""

-- Retrieve power info from OS
set powerInfo to do shell script "pmset -g ps" as string

set powerInfo1 to paragraph 1 of powerInfo

-- Determine power source
set powerSource to text ((offset of "'" in powerInfo1) + 1) thru ((length of powerInfo1) - 1) of powerInfo1

-- Determine power metrics
set powerInfo2 to paragraph 2 of powerInfo
set powerInfo2 to trim(text ((offset of tab in powerInfo2) + 1) thru (length of powerInfo2) of powerInfo2)

set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to {";"}
set PowerInfo2Items to every text item of powerInfo2
set AppleScript's text item delimiters to oldDelims

set powerLevel to trim(item 1 of PowerInfo2Items)

set powerState to trim(item 2 of PowerInfo2Items)

set powerTime to trim(item 3 of PowerInfo2Items)

if powerTime contains "estimate" then
-- estimate not available
set powerTime to "calculating the time"
else
-- extract the estimate
set powerTimeHours to text 1 thru ((offset of ":" in powerTime) - 1) of powerTime as integer
set powerTimeMinutes to text ((offset of ":" in powerTime) + 1) thru ((offset of " " in powerTime) - 1) of powerTime as integer

set powerTime to ""

if powerTimeHours is 1 then
set powerTime to "1 hour"
end if
if powerTimeHours is greater than 1 then
set powerTime to powerTimeHours & " hours"
end if -- time includes hours

if powerTimeHours is greater than 0 and powerTimeMinutes is greater than 0 then
set powerTime to powerTime & " and "
end if

if powerTimeMinutes is 1 then
set powerTime to powerTime & "1 minute"
end if
if powerTimeMinutes is greater than 1 then
set powerTime to powerTime & powerTimeMinutes & " minutes"
end if

end if -- time estimate available

-- Build the announcement

if powerState is "charged" then
set message to "The battery is fully charged."
end if
if powerState is "charging" then
set message to powerLevel & " recharged. " & powerTime & " until fully charged."
end if
if powerState is "discharging" then
set message to powerLevel & " battery power. " & powerTime & " remaining until empty."
end if

tell application "VoiceOver" to output message

Copy all of that into script editor and test it by pressing command R. Once that is working, save it in a memorable place, hop back over to VoiceOver, make sure that 'control VoiceOver with apple script' is set to on in the general tab, then head down the tabs to commanders, select keyboard, go to add, choose a key and in the commander menu, select custom, apple script and then point it to your battery script.

Hope this helps.

Submitted by Oliver Kennett on Tuesday, October 15, 2019

Good. Scripting is really satisfying when you get it working. I've got some to roll different dice accompanied by a sound for when I'm playing table top RPGs.