In my last post, I demonstrated how to write an AppleScript that verbally announces when new emails arrive in Mail. Some readers asked whether the same thing could be accomplished with Microsoft Outlook. It certainly can. Here's how...
Creating and Installing the Script
1. Launch AppleScript Editor (in /Applications/Utilities) and create a new script document.
2. Enter the following script into the document.
NOTE: If you have any trouble following along, you can download the completed script here.
NOTE: This script was written and tested with Microsoft Outlook 2011, version 14.3.2, running in OS X 10.8.3, Mountain Lion. You can test the script by running it in AppleScript Editor. Select a message or two in Outlook. Then, return to AppleScript Editor and click Run in the script document's window.
3. Make any adjustments to the properties at the top of the script to customize its behavior. For example, if you don't want the script to raise your volume if it's too low, change the raiseVolumeIfNeeded property value to false. If you don't want the script to read the first few paragraphs of each message to you, set the readFirstParagraphsOfEachMessage property value to false.
Modifiable Properties in the Script
4. Save the script in Script format to your Desktop as Outlook > Announce New Emails By Voice.scpt.
Saving the script to the Desktop
5. Launch Outlook. From its script menu, choose About This Menu... In the dialog that appears, click Open Folder. This opens the Outlook Script Menu Items folder, which is either in your ~Documents/Microsoft User Data folder or your ~/Library/Application Support/Microsoft/Office folder, depending on the version of Office you have installed.
The Microsoft Outlook Script Menu
Click the Open Folder button to display the Outlook Script Menu Items folder.
6. Move the Outlook > Announce New Emails By Voice.scpt file from your desktop into the Outlook Script Menu Items folder.
The Outlook Script Menu Items folder may contain some default scripts provided by Microsoft.
Adding an Email Rule
Now that you've installed the script, you can run it from the script menu in Outlook. But, you really want a script like this to run automatically when new emails arrive. So, you need to configure a rule to do this.
1. Select Tools > Rules... to display the Rules window.
Outlook's Rules window
2. Click the appropriate type of account, i.e. Exchange, IMAP, POP, and click the + button to create a new rule.
3. Name the rule Announce New Emails By Voice and set it to trigger on All Messages. Set the rule's action to Run AppleScript. Click the Script... button and choose your saved script in the Outlook Script Menu Items folder. Click OK to close the rule.
The configured rule, set to run your script
Now, whenever a new email arrives for the specified type of account, the rule should trigger your script to announce the new messages. If you want to disable the announcements at any time, just go back to the Rules window and de-select the Enabled checkbox next to the rule. Happy scripting!
You can disable the announcement script in the Rules window whenever you want