Skip to content

Instantly share code, notes, and snippets.

@jmakeig
Last active December 24, 2015 14:19
Show Gist options
  • Save jmakeig/6811730 to your computer and use it in GitHub Desktop.
Save jmakeig/6811730 to your computer and use it in GitHub Desktop.
Have the OS speak the selected text from Word. This is a system service in most Mac apps, but not in Office.
tell application "Microsoft Word"
activate
tell selection
set myText to content of text object
end tell
end tell
tell application "System Events"
-- Fork it to another process so it doesn't prevent you from doing other stuff in the foreground in Word
do shell script "echo " & myText & " | say > /dev/null 2>&1 &"
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment