Last active
December 24, 2015 14:19
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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