Aimless noise and insights into my little world

Showing posts with label productivity. Show all posts
Showing posts with label productivity. Show all posts

Friday, October 12, 2007

Applescript to make an iCal event from an email

So after much gnashing of teeth and swearing about Applescript I got my little app to work. I have an Act-on key binding which triggers a script. The script takes the email and dumps it into iCal, for further correction (e.g. setting date/time of the event). If I was feeling brave/stupid I'd get the script to parse out the date, but I really don't want to do that! The script was based on a mail to todo item script I found.

using terms from application "Mail"
on perform mail action with messages selectedMessages
try
set theCalendar to "WorkEvents"
repeat with mail in selectedMessages

set theSummary to the subject of the mail
set theDescription to the content of the mail
set theDate to the date received of the mail

tell application "iCal"
make new event at the end of events of (every calendar whose
title = theCalendar) with properties {summary:theSummary,
description:theDescription, start date:theDate}
end tell
set read status of the mail to true
delete the mail
end repeat
on error errMsg number errorNumber
display dialog ("An error occurred: " & errorNumber as string)
end try
end perform mail action with messages

end using terms from


The following script does similar work, but creates a todo item instead of a new event. It also doesn't delete the original mail.


using terms from application "Mail"
on perform mail action with messages selectedMessages
try
set theCalendar to "WorkEvents"
--say theCalendar
repeat with mail in selectedMessages

set theSummary to the subject of the mail
set theDescription to the content of the mail

tell application "iCal"
--set theCalendar to choose from list every calendar with
prompt "Choose name or cancel"
make new todo at the end of todos of (every calendar whose
title = theCalendar) with properties {summary:theSummary,
description:theDescription}
end tell
set read status of the mail to true
--delete the mail
end repeat
on error errMsg number errorNumber
display dialog ("An error occurred: " & errorNumber as string)
end try
end perform mail action with messages

end using terms from

Thursday, October 11, 2007

Email woes

So I was watching a video of a talk given by Merlin Mann about "Inbox Zero" and it's got me thinking. I have a lot of email. A LOT.
In fact much of my day is spent dealing with mail. It comes at me from all directions, and can get to be too much. I can't "just check" my mail - it will always trigger some sort of action (writing another mail, usually). I know this annoys Chloe, too, something must be done! So I've decided to put some of Merlin's ideas into action.

First I deleted all the mails from various lists I'm on. They're archived at CERN so if I need to I can trawl them online, but I don't think I ever will. It was quite satisfying deleting over 6000 mails that were of no real direct relevance to me.

Next I created two DMZ regions in my CERN and Bristol mail accounts, and put all the mails in those two inboxes into them. My inbox is now slimline. One day I'll sort through all those mails (or just delete them if I don't go into the DMZ's much in the next month or so).

Third I've taken it on myself to delete any mail that comes my way once the appropriate action has been taken. I've also set the email check time to 30mins instead of 5. I might up that to an hour depending on how things go... If it's urgent people can still get me on IM (though maybe that will change in the future...).

Next is to set up the Mail Act-On rules and see how they go. I'm also going to write a little automator script to take an email and make it an entry in iCal.