Skip to content

Instantly share code, notes, and snippets.

@jsleeio
Last active April 14, 2023 07:12
Show Gist options
  • Save jsleeio/bb675310cad32627a02ee9eb1b70e0f4 to your computer and use it in GitHub Desktop.
Save jsleeio/bb675310cad32627a02ee9eb1b70e0f4 to your computer and use it in GitHub Desktop.
macOS whisperer

what is this?

Applescript gadget that politely saves volume/mute settings, unmutes, sets volume very low, whispers some text provided on the commandline (the first CLI argument only) then politely restores the volume/mute settings. Polite!

Don't install this to unattended MacBooks. Definitely don't make it run as a cron job...

howto

chmod +x whisperer.osascript
./whisperer.osascript 'please be quiet! this is a library'
#!/usr/bin/osascript
on run argv
set saveVolume to get volume settings
if output muted of saveVolume is true then
set volume without output muted
end if
set volume output volume 10
say item 1 of argv using "Whisper"
set volume output volume (output volume of saveVolume)
if output muted of saveVolume is true then
set volume with output muted
end if
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment