Showing posts with label MobileMe. Show all posts
Showing posts with label MobileMe. Show all posts

Sunday, July 26, 2009

Birthdays Calendar on iPhone

I finally figured out how to get the "Birthdays" calendar to show up on the iPhone! It's a bit of hack, but at least it's automated. Note: you need to be a MobileMe subscriber for this. I'm sure there's a way without MobileMe, but this is what I used.
  1. Right-click on the "Birthdays" calendar in iCal on your desktop Mac, and select Publish...
  2. Select Publish on: MobileMe and check all the checkboxes. Then click the Publish button.
  3. On the iPhone, go into the Settings app and tap Mail, Contacts, Calendars.
  4. In the Accounts section, tap Add Account... and select Other.
  5. In the Server field, type: homepage.mac.com/username/.calendars/Birthdays.ics
  6. In the Description field, type: Birthdays
  7. Leave Username and Password blank.
  8. Set both Use SSL and Remove Alarms to OFF.
  9. Save and exit the Settings app.
Unfortunately there doesn't seem to be a way to change the colour of the calendar, and on mine that means it doesn't match the green colour of the Birthdays calendar on my desktop.

Sunday, June 21, 2009

How to Stop MobileMe from Deleting Trash After 30 Days

MobileMe email has the annoying "feature" that unlike Gmail, if you "delete" an email, it only stays in the "Trash" folder for 30 days.

Here is a simple workaround for this problem:
  1. Log into the MobileMe Mail site, and add a folder called "Archive" (or something else if you prefer). Move all your existing deleted emails in your Trash folder into Archive.
  2. If you use MobileMe with Mail.app, right-click your MobileMe Inbox and select Synchronize MobileMe. Your new Archive folder should appear somewhere on the mailboxes pane. Select the Archive folder, and then go up to the Mailboxes menu and select Use this mailbox for > Trash. On my system, it changed the name of the folder to "Deleted Messages" when I did this.
  3. If you use MobileMe on your iPhone, go into the Settings app and then Mail, Contacts, Calendars > MobileMe > Account Info > Advanced > Deleted Mailbox, then select your Archive folder.
This might actually make the new search on server feature useful!

Disclaimer: I just followed the above steps today. In theory it should work, but the above is untested. I will post a follow-up if I have any problems...

Thursday, August 07, 2008

AppleScript to generate iCal events from email

I just figured out a way to get my work calendar copied onto my iPhone! Yay!!

A bit of background first:

My company doesn't have Exchange, or any other real "groupware". For email, there's just a simple POP server (uuurgh!) and for calendar, they have a custom-built intranet application (huh?!).

The intranet calendar system has a function to send an automatic email alert whenever somebody books an appointment with me in my calendar. The email goes to my work email account, but I have configured an Outlook rule to automatically forward it to my home email address.

When it arrives at my Mac at home (which is always on), I have a Rule in Mail.app which runs the below AppleScript. The script parses the contents of the email, and creates a new event in iCal.

iCal syncs with MobileMe, which in turn syncs with my iPhone. Hooray!!

I haven't used this in anger yet, so I'll be trying it out for the first time tomorrow.

Known limitations:

  • It's highly customised to the format of the emails I get from the intranet calendar system.
  • It doesn't automatically handle recurring events. The first event will be registered, but I have to set the recurring settings myself.
  • It doesn't handle updates or cancellations of events. If an event is moved, it will simply register it again at the new date/time. The old one will still be there.
I'm yet to discover just how long it takes for a new event to finally show up on my iPhone, but based on experience with MobileMe "push", I'm expecting at least a 15~20 minute delay.

How to install:
  1. Launch the application Script Editor and copy the code below.
  2. Save the script somewhere. I saved it in my Documents folder as "MailToCalendar".
  3. Open Mail and select Mail > Preferences... from the menu bar.
  4. Under Rules, click Add Rule.
  5. Give the rule a name (mine is "MailToCalendar").
  6. Create the conditions to recognise the alert emails (mine is Subject Contains "スケジュール予約状況案内").
  7. Add the actions Delete Message, Mark as Read, and Run AppleScript (pointing to the location of the AppleScript you saved).
  8. Click OK. That's it.
Many thanks to AK who gave me a sample AppleScript to get started with! :-)
(*
Make an iCal event from an email
AK  IT Carlow Ireland May 2005
and Will Hains Tokyo August 2008
*)

 

using terms from application "Mail" on perform mail action with messages MessageList for rule theRule -- say "Starting MailToCalendar" set OldDelim to AppleScript's text item delimiters

tell application "Mail" set ThisOne to item 1 of MessageList set TheDetails to content of ThisOne end tell --Mail

set AppleScript's text item delimiters to {"\n"} set TheDetails to text items of TheDetails set TheTopic to "" set TheStart to current date set TheEnd to current date set ThePlace to "" set TheDescription to ""

repeat with ThisDetail in TheDetails set AppleScript's text item delimiters to {"\n"} try -- find the date if "日付:" is in text item 1 of ThisDetail then set AppleScript's text item delimiters to {":"} set TheDateTimeRange to text item 2 of ThisDetail

set AppleScript's text item delimiters to {"-"} set TheStartDateTime to text item 1 of TheDateTimeRange set TheEndDateTime to text item 2 of TheDateTimeRange

set AppleScript's text item delimiters to {" "} set TheStartDate to text item 1 of TheStartDateTime set TheStartTime to text item 2 of TheStartDateTime set TheEndDate to text item 1 of TheEndDateTime set TheEndTime to text item 2 of TheEndDateTime

set AppleScript's text item delimiters to {"/"} set year of TheStart to text item 1 of TheStartDate set month of TheStart to text item 2 of TheStartDate set day of TheStart to text item 3 of TheStartDate set year of TheEnd to text item 1 of TheEndDate set month of TheEnd to text item 2 of TheEndDate set day of TheEnd to text item 3 of TheEndDate

set AppleScript's text item delimiters to {":"} set time of TheStart to (text item 1 of TheStartTime) * hours + (text item 2 of TheStartTime) * minutes set time of TheEnd to (text item 1 of TheEndTime) * hours + (text item 2 of TheEndTime) * minutes

-- say "the start is " & TheStart -- say "the end is " & TheEnd end if --Date

-- find the place if "利用設備:" is in text item 1 of ThisDetail then set AppleScript's text item delimiters to {":"} set TheMeetingRoom to text item 2 of ThisDetail set AppleScript's text item delimiters to {"会議室"} set ThePlace to text item 1 of TheMeetingRoom -- say "place is " & ThePlace end if --Place

-- find the topic if "予定:" is in text item 1 of ThisDetail then set AppleScript's text item delimiters to {":"} set TheTopic to text item 2 of ThisDetail -- say "the topic is " & TheTopic end if --Title

-- find the description if "内容:" is in text item 1 of ThisDetail then set AppleScript's text item delimiters to {":"} set TheDescription to text item 2 of ThisDetail -- say "the description is " & TheDescription end if --Description

on error errStr number errorNumber say "MailToCalendar error! " & errStr end try end repeat --iterate through fields

--set up the event in iCal tell application "iCal" -- say "Will now attempt to register in iCal" tell calendar 2 --CHANGE THIS to sequence number of target calendar set newItem to make new event at end of events with properties {start date:TheStart, end date:TheEnd} set summary of newItem to TheTopic set location of newItem to ThePlace set description of newItem to TheDescription -- say "registered in iCal" end tell --calendar end tell -- iCal

set AppleScript's text item delimiters to OldDelim -- say "finished MailToCalendar" end perform mail action with messages end using terms from