set mylist to {{"Monday", "MO"}, {"Tuesday", "TU"}, {"Wednesday", "WE"}, {"Thursday", "TH"}, {"Friday", "FR"}, {"Saturday", "SA"}, {"Sunday", "SU"}} on splitString(str, delimiter) set savedTextItemDelimiters to AppleScript's text item delimiters try set AppleScript's text item delimiters to {delimiter} set splitList to every text item of str set AppleScript's text item delimiters to savedTextItemDelimiters on error m number n from f to t partial result p set AppleScript's text item delimiters to savedTextItemDelimiters error m number n from f to t partial result p end try return splitList end splitString -- doesn't create duplicates. adds todo's to calendar "Personal" on createTodo(summaryText) set now to current date set midnight to now - (time of now) tell application "iCal" -- don't create an item if it already exists for today! if (count (every todo in calendar "Personal" whose due date ≥ midnight and summary = summaryText)) < 1 then make new todo at end of calendar "Personal" with properties ({due date:midnight, summary:summaryText}) end if end tell end createTodo on getLabel(recurrence, label) set descriptors to my splitString(recurrence, ";") set prefix to (label & "=") repeat with descriptor in descriptors if descriptor starts with prefix then set byday to descriptor return get text ((length of prefix) + 1) thru (length of byday as string) of byday end if end repeat return missing value end getLabel tell application "iCal" repeat with pair in mylist set weekdayString to weekday of (current date) as string if (pair as list) starts with weekdayString then set foundPair to pair end if end repeat set weekdayCode to item 2 of foundPair repeat with evt in every event in calendar "Shadow" set recurrsOnThisWeekday to false set frequency to my getLabel(recurrence of evt, "FREQ") if frequency is "WEEKLY" then set days to my getLabel(recurrence of evt, "BYDAY") if days is not missing value and my splitString(days, ",") contains weekdayCode then set recurrsOnThisWeekday to true end if else if frequency is "DAILY" then set recurrsOnThisWeekday to true end if if recurrsOnThisWeekday then log (summary of evt) my createTodo(summary of evt) end if end repeat end tell