ForumsThird-Party ApplicationsOutlook 2011 for Mac to ToodleDo


Outlook 2011 for Mac to ToodleDo
Author Message
exotherm

Posted: Apr 27, 2011
Score: 1 Reference
Hi Everybody,

Have a Mac? Use Outlook 2011 for email? Use Toodledo?

If yes to all three, here is an Applescript to automatically make a Toodledo task from an email item in Outlook. You can use the Toodledo syntax to name the task, star it, assign prorities, etc. The email message body will be added to the task as a note automatically. Don't use your email inbox as a to do list! :)

To set it up, turn on the Toodledo email service (http://www.toodledo.com/connect_email.php). Next, open Applescript Editor (just start typing that into Spotlight and it will come up). Create a new script, then paste the code below into the new window. Change the Toodledo email address "[email protected]" (near the end of the script) to the address supplied by the Toodledo email service page. Save the file as "ToodledoTaskMaker" or something and save it in the User:Documents:Microsoft User Data:Outlook Script Menu Items folder. Now you can access it from Outlook via the little script icon in the menu bar.

Cheers,
Brian



***Paste this text into Applescript Editor:
-- Create Toodledo Task from Outlook 2011 Message
-- Created by BLP 27Apr2011 with ample contributions from fellow internet posters

tell application "Microsoft Outlook"

-- get the currently selected message or messages
set selectedMessages to current messages

-- if there are no messages selected, warn the user and then quit
if selectedMessages is {} then
display dialog "Please select a message first and then run this script." with icon 1
return
end if

repeat with theMessage in selectedMessages

-- get the information from the message, and store it in variables
set theSubject to subject of theMessage as string
set theSenderObj to sender of theMessage

-- prompt for Toodledo syntax additions, for more info see http://www.toodledo.com/info/help_email.php
set myPrompt to ("Task name and Toodledo syntax to add?" & linefeed & linefeed & "Star: *" & linefeed & "Priority: !" & linefeed & "Due-date: #DueDate" & linefeed & "Due Time: =DueTime" & linefeed & "Start Date: >StartDate" & linefeed & "Start Time: ^StartTime" & linefeed & "Reminder: :ReminderLeadTime" & linefeed & "Length: ~LengthTime" & linefeed & "Folder: *FolderName" & linefeed & "Context: @ContextName" & linefeed & "Goal: +GoalName" & linefeed & "Tag: %TagName,TagName2,…" & linefeed & "Location: - LocationName" & linefeed & "Repeat: &RepeatDescription" & linefeed & "Status: $StatusSetting")
set newsubject to text returned of (display dialog myPrompt buttons {"Ok"} default button 1 default answer "")
if newsubject is "" then set newsubject to "Task from Outlook: " & theSubject


-- add sender, date and plain text of original message as note for Toodledo item
set theSenderName to (address of theSenderObj) --address only because Applescript will give an error if the message sender doesn't have a name (only email address)
set myContent to "On " & (time sent of theMessage as string) & ", " & theSenderName & " wrote:<br><br>" & (content of theMessage as text)

-- build outgoing message
set newMessage to make new outgoing message in outbox with properties {subject:newsubject, content:myContent}
make new recipient of newMessage with properties {email address:{address:"[email protected]"}} --Replace this with you own Toodledo email

-- send the new message
run send all

end repeat
end tell


This message was edited Apr 27, 2011.
makis.marmaridis

Posted: Jul 17, 2011
Score: 1 Reference
Hi Brian,

Thank you for making this script available, it is very useful indeed!

I have made 2 small modifications that I thought to share with everyone, these are:

1. Added a "cancel" button and
2. Because the todo text takes the place of the subject line and that may be important, I have put the original subject line in the body and therefore shows up in the "notes" section of the todo item.

I have also made a trigger (keyboard binding) in quicksilver so I can run this script without touching the mouse. Hope this is useful to people - complete script shown below.

***Paste this text into Applescript Editor:
-- Create Toodledo Task from Outlook 2011 Message
-- Created by BLP 27Apr2011 with ample contributions from fellow internet posters

tell application "Microsoft Outlook"

-- get the currently selected message or messages
set selectedMessages to current messages

-- if there are no messages selected, warn the user and then quit
if selectedMessages is {} then
display dialog "Please select a message first and then run this script." with icon 1
return
end if

repeat with theMessage in selectedMessages

-- get the information from the message, and store it in variables
set theSubject to subject of theMessage as string
set theSenderObj to sender of theMessage

-- prompt for Toodledo syntax additions, for more info see http://www.toodledo.com/info/help_email.php
set myPrompt to ("Task name and Toodledo syntax to add?" & linefeed & linefeed & "Star: *" & linefeed & "Priority: !" & linefeed & "Due-date: #DueDate" & linefeed & "Due Time: =DueTime" & linefeed & "Start Date: >StartDate" & linefeed & "Start Time: ^StartTime" & linefeed & "Reminder: :ReminderLeadTime" & linefeed & "Length: ~LengthTime" & linefeed & "Folder: *FolderName" & linefeed & "Context: @ContextName" & linefeed & "Goal: +GoalName" & linefeed & "Tag: %TagName,TagName2,…" & linefeed & "Location: - LocationName" & linefeed & "Repeat: &RepeatDescription" & linefeed & "Status: $StatusSetting")
set newsubject to text returned of (display dialog myPrompt buttons {"Ok", "Cancel"} default button 1 default answer "")
if newsubject is "" then set newsubject to "Task from Outlook: " & theSubject


-- add sender, date and plain text of original message as note for Toodledo item
set theSenderName to (address of theSenderObj) --address only because Applescript will give an error if the message sender doesn't have a name (only email address)
set myContent to "On " & (time sent of theMessage as string) & ", " & theSenderName & " wrote:" & "Subject: " & theSubject & "" & (content of theMessage as text)

-- build outgoing message
set newMessage to make new outgoing message in outbox with properties {subject:newsubject, content:myContent}
make new recipient of newMessage with properties {email address:{address:"[email protected]"}} --Replace this with you own Toodledo email

-- send the new message
run send all

end repeat
end tell
erwindebeer

Posted: Sep 29, 2011
Score: 0 Reference
Thnx so much. This was what I was looking for ever since I switched from Windows to Mac last month. It now will be so easy to break all of my old productivity records. Extra free time, here I come :))
You cannot reply yet

U Back to topic home

R Post a reply

To participate in these forums, you must be signed in.