Skip to main content
Home

Main navigation

  • Apps
  • Forum
  • Blog
    • Podcast
    • Guides
    • Hardware & Accessory Reviews
    • Bug Tracker
    • Developer Resources
  • Log in

Breadcrumb

  1. Home
  2. Guides

Making VoiceOver announce the time and date on your Mac

Important

This guide is outdated and may not provide accurate information for current use cases. It is being retained as a recognition of the author's contribution, but it should be regarded as archived.

By Chris Norman, 18 June, 2014

This is an updated and refined version of this guide, now that I've learned a little more, and stopped being so confused.

So we all know about the keyboard commander, and how you can make it read the time when you press option + t, but I personally find that method really really slow. In addition, for me at least, the date doesn't even read some times. So I set to making my own solution.

So, if you've got VoiceOver controllable by Applescript (in the General tab), you can make it say stuff etc.

Note: The reason this is v2 of this guide, is the following run from AppleScript editor, although working, will not work...

tell application "voiceover" to output "Hello world."

This is because AppleScript editor makes VoiceOver say "Run", after the script has been executed, thus you don't hear what you told VoiceOver to say.

Anyways, here's my updated time script, which you just need to point a keyboard command, quicknav key, or any other trigger of your choosing towards:

tell application "VoiceOver" to output (do shell script "date +\"%d %h %Y, %H %M %S\"")

In addition, as a bonus for me being so stupid and not getting VoiceOver to talk before, here's my other scripts:

Battery.scpt:
tell application "VoiceOver" to output (do shell script "pmset -g batt")

Disk Usage.scpt:
tell application "VoiceOver" to output (do shell script "df -h | head -2 | tail -1")

Date Reader.scpt:
tell application "VoiceOver" to output (do shell script "date +\"%d %h %Y, %H %M %S\"")

Memory.scpt:
tell application "VoiceOver" to output (do shell script "memory_pressure | grep \"memory free\"")

Ping.scpt:
tell application "VoiceOver" to output (do shell script "if ping -c1 bbc.co.uk > /dev/null;
then msg=\"up\";
else msg=\"down\";
fi;
echo \"Net is $msg\"")

Note: You have to send ping's output to /dev/null (nowhere), otherwise VoiceOver reads all that too.

Enjoy, and happy hacking.

Tags
macOS
Miscellaneous
Programming (macOS)
VoiceOver

Disclaimer

The article on this page has generously been submitted by a member of the AppleVis community. As AppleVis is a community-powered website, we make no guarantee, either express or implied, of the accuracy or completeness of the information.

Options

  • Log in or register to post comments

Comments

Making VoiceOver announce the time and date on your Mac - Revise

By Jeff Wheatley

6 years 6 months ago

I like Chris's scripts so much that I spent some time to add a bit of filtering to the output so I get the most important info. Chris, I hope you do not mind my steeling and revising your great work!

To use these scripts, as Chris explains in the original post, use the Script Editor to cut / paste each of these into a separate file. Then use the VoiceOver Utility's Keyboard Commander to assign keystrokes to each of these AppleScripts.

If you wish to extend or change these scripts, note that the bulk of the work is done by the UNIX shell scripting embedded in the VoiceOver output command (date, grep, cut, memory_pressure, etc.). If you know shell script, you can enhance / come up with other useful scripts to create.

-- Time of Day
tell application "VoiceOver" to output (do shell script "date +\"%l %M %p, %A %d %h %Y\"")
-- Example result: 3:47 PM, Sunday 18 September 2016
-- Google the UNIX date syntax to learn the meaning of the various %x items if you want to change the output.

-- Battery Status
tell application "VoiceOver"
output (do shell script "pmset -g batt | grep InternalBattery | cut -d ' ' -f 3-4")
delay 1
output (do shell script "pmset -g batt | grep drawing | cut -d ' ' -f 4-")
end tell
-- Example result: 61%, Discharging, Battery Power

-- Disk Free
tell application "VoiceOver"
output (do shell script "df -h | head -2 | tail -1 | tr -s ' ' | cut -d ' ' -f 4")
end tell
-- Example result: 122Gi
-- read this as 122G; not sure why the i is appended...

-- Working memory free%
tell application "VoiceOver"
output (do shell script "memory_pressure | grep \"memory free\" | cut -d ' ' -f 5")
end tell
-- Example result: 58%

Hope you find this useful...

If it stops working ...

By PaulMartz

1 year 12 months ago

Member of the AppleVis Blog Team

I've discovered sometimes these scripts simply stop working. To fix, try opening the VO Utility and toggling the checkbox to allow AppleScript to control VoiceOver.

LOL. Glad I left this note to myself

By PaulMartz

1 year 10 months ago

Member of the AppleVis Blog Team

In reply to If it stops working ... by PaulMartz

The script stopped working again after the upgrade to 11.3.1. Again, opening the VO Utility and toggling the checkbox to allow AppleScript to control VoiceOver remedied the issue.

Battery and such

By glassheart

1 year 10 months ago

Chris? If this works with the battery status and such? You my friend are going to be a lifesaver! I've been looking for those scripts for years now! Thank you thank you thank you!

More Like This

Problem Using Spoken Track Service (Forum Topic)
AppleScript to indicate battery status (Forum Topic)
Timer (Forum Topic)
Release: colloquy automatic speech script (Forum Topic)
When using drag and drop to rearrange the position of a shortcut in the Shortcuts app, VoiceOver does not provide meaningful feedback whilst dragging regarding where the shortcut will be placed when dropped (iOS or iPadOS Bug Report)
Opening .msg files in Mac OS X (Forum Topic)
IOS voicemail full notification? (Forum Topic)
Question about an AppleScript for speaking battery status (Forum Topic)

Site Information

  • About
  • Club AppleVis
  • FAQ
  • Contact

Unless stated otherwise, all content is copyright AppleVis. All rights reserved. © 2023 | Accessibility | Terms | Privacy