Merlin – Creating tasks out of an iCal calendar

With Merlin you can create proffessional project schedules. You can export or sync your tasks to iCal and have them in you calendar application. We have posted an AppleScript showing how one could export the tasks of the current selection.

You also know how to import an iCal calendar as exceptions to your project or resource’s calendar.

What should you do, in case you would like to import the events of your iCal calendar as tasks?

You can create tasks out of the following formats:

  • MS Project (.mpx, .mpp, .xml)
  • OmniOutliner (.ooutline, .oo3)
  • OmniPlan (.omniplan)
  • NovaMind (.nmind)
  • MindManager (.mmap)
  • Merlin 1 (.merlin)
  • Merlin 2 (.xml)
  • Text files (.txt, .csv, .tsv)
  • OPML files (.opml)

Unfortunately iCal (.ics) is not one of them, you may however write an AppleScript creating tasks out of events of selected iCal calendars.

To make a long story short… here is such a script…

	This script requires iCal. It prompts the list of your iCal calendars for you to select the calendar out of which new tasks should be created in Merlin. It writes in the top most opened Merlin project.
	Written by Vicky Stamatopoulou
	For ProjectWizards
	Nov 3, 2010

property CalendarSelectionMessage : "Which calendar should be transferred to Merlin?"
property EventsImportMessage1 : " events found in calender  "
property EventsImportMessage2 : ". Are you sure you want to import them all?"
property DoneMessage : " tasks created. Please enable 'Given Planned Earliest Start' column, sort by it and adjust project's start date if neccessary."
property ErrorMessage : "There were no tasks in the calendar, so there are no new tasks created."
tell application "iCal"

	set theCals to title of calendars

	set theCal to choose from list theCals with prompt CalendarSelectionMessage without multiple selections allowed

	if theCal is not false then
		set myCal to item 1 of (calendars whose title contains theCal)

		set TheEvents to events of myCal

		if (count of TheEvents) > 0 then
			display dialog ((count of TheEvents) & EventsImportMessage1 & title of myCal & EventsImportMessage2) as text
			set I to 0
			repeat with AnEvent in TheEvents

				tell AnEvent
					set ASummary to summary
					set AStart to start date
					set AnEnd to end date
				end tell

				tell application "Merlin"

					set theAct to make new activity at end of activities of root project of the first document
					tell theAct
						set title to ASummary
						set given planned start date min to AStart
						set given planned end date min to AnEnd
						delete given planned work

					end tell

				end tell
				set I to I + 1

			end repeat

			tell application "Merlin"
				display dialog I & DoneMessage as text buttons {"Ok"}
			end tell
			display dialog ErrorMessage buttons {"Ok"}
		end if
	end if
end tell

One thought on “Merlin – Creating tasks out of an iCal calendar

  1. Pingback: Merlin – Creating Milestones out of iCal todos » MacPM

Comments are closed.