AppleScript and Recurring Events

I'm trying to create an AppleScript that will, essentially, e-mail every event for the week to Remember The Milk so that, on the iPhone, I can pull up Appigo's To Do and get an overview of everything I have to do for the day-- both RTM tasks and iCal events. For all non-recurring events, I'm in great shape.
The problem, of course, is the way iCal handles recurring events and start dates. Because it considers the start date to be only the first occurrence of a recurring event, they're excluded when start dates are used to get only those events that occur within a specific timeframe.
I can get all of my recurring events rather easily (although if anyone knows of better way than +...whose recurrence is not ""+ I'd be in your debt), but I don't want to sync every instance of the event. When regular appointments are canceled/rescheduled, I don't want to have to change them in multiple locations.
Is there a way to get AppleScript to work with only a single occurrence of a recurring event? (Or, preferably, several single occurrences, considering that I've got anywhere between ten and thirty recurring events, depending on the week.)
I had the thought of, before syncing every week, deleting any previous occurrence of a recurring event, but the script prompts me for the number of days I want to sync each time it runs, and I can foresee wanting to sync two or three weeks at a time, in which case simply deleting the event doesn't really solve the problem anyway.
null

Several lines of the “broken” script seem to be badly written, for example:
    set root_Folder to rootFolder as alias -- rootFolder instead of root_Folder
    set events_Folder to events_Foler as alias -- Foler instead of Folder
Message was edited by: Pierre L.

Similar Messages

  • How can I get all of my calendars and recurring events to synch via iCloud with my iPad2?

    Not all of my recurring events sych via the iCloud with my Mac and IOS devices - most specifically my iPad2. For example, my anniversary appears on my Mac and my iPhone, but not on my iPad2.
    I notice that when I click on "Calendars" when the iCal app is open in my iPhone I get 2 lists of calendars - one that is labled "On my iphone" and the other that is labled "iCloud". The same two lists appear in the iCal app on my Mac. But on my iPad2 the only list that appears is "iCloud".
    Can anyone help with this issue?

    Welcome to the Apple community.
    Contacts aren't backed up and therefore aren't restored from a back up either. They are synced with the cloud, so after you have restored your device you should be able to sign back into your account and turn syncing back on again. If you need to check if your contacts are in the cloud, go to iCloud.com on a computer.

  • ICal 2.0.2 and recurring events

    I am running iCal 2.0.2 on OS X 10.4.2. I have a seperate calendar for my school schedule with my classes as recurring events.
    iCal, at some point, changed all the recurrences. Events now terminate in October instead of December, and several of them are even duplicated on the same day. I don't know how or why this has happened. I tried editing the events, but the same problem happened: events duplicated on the same day, not recurring to the proper set date. I finally have trashed the whole calendar and am going to rebuild it. Any thoughts on why this happened, and what to do if it happens again?

    Too late to try to save what existed?
    I would try these (one at a time)
    a) Quit iCal then trash iCal prefs in your user Library folder: ~/Library/Preferences/com.apple.iCal.plist
    b) I'd try exporting the Calendars, deleting the originals and reimporting
    c) make a backup (File/Backup Database...) then revert to backup (File/Revert to Database Backup...)
    d) Comeback for more advice if none of this works.

  • AppleScript for recurring events in Outlook calendar

    I'm trying to write an AppleScript that will create a new appointment with properties that are derived from the properties of a specific appointment that is part of a recurring series in an Outlook calendar.
    Outlook 14.2.5
    AppleScript Editor version 2.3
    In the Microsoft Outlook window in the editor, the calendar event help information shows two distinct properties:
    is recurring (boolean, r/o):  Indicates whehter an event is part of a recurring series of events.    (the typo in "whehter" is actually in the help information!)
    is occurrence (boolean, r/o) : Indicates whether an event is an occurrence of a recurring series
    I don't understand the difference between these two.  If I have a series of appointment (say one meeting every day for three days), and I have selected the second appointment in that series, "is occurrence" is false, but "is recurring" is true.  What is the difference?
    My ultimate objective is to extract the start time of the specific appointment that is selected, but when I use the "start time" property of the selection (the second appointment in the series of three appointments), my script is returning the start date/time of the first appointment in the series.
    set selectedEvent to selection
    set startTime to start time of selectedEvent   <-- this is returning the start time of the first appointment in the series - not the start time of the particular occurrence that is selected in the calendar (which is what I actually want)
    Julia Bell

    I'm trying to write an AppleScript that will create a new appointment with properties that are derived from the properties of a specific appointment that is part of a recurring series in an Outlook calendar.
    Outlook 14.2.5
    AppleScript Editor version 2.3
    In the Microsoft Outlook window in the editor, the calendar event help information shows two distinct properties:
    is recurring (boolean, r/o):  Indicates whehter an event is part of a recurring series of events.    (the typo in "whehter" is actually in the help information!)
    is occurrence (boolean, r/o) : Indicates whether an event is an occurrence of a recurring series
    I don't understand the difference between these two.  If I have a series of appointment (say one meeting every day for three days), and I have selected the second appointment in that series, "is occurrence" is false, but "is recurring" is true.  What is the difference?
    My ultimate objective is to extract the start time of the specific appointment that is selected, but when I use the "start time" property of the selection (the second appointment in the series of three appointments), my script is returning the start date/time of the first appointment in the series.
    set selectedEvent to selection
    set startTime to start time of selectedEvent   <-- this is returning the start time of the first appointment in the series - not the start time of the particular occurrence that is selected in the calendar (which is what I actually want)
    Julia Bell

  • Applescript and Image Events

    The following script works correctly:
    property openTypes : {"PDF", "com.adobe.pdf", "BMP", "com.microsoft.bmp", "JPEG", "JPEG2", "jpg", "public.jpeg", "PICT", "com.apple.pict", "PNG", "public.png", "PSD", "com.adobe.photoshop-image", "TIFF", "public.tiff"}
    global eventsFolder, ProcessedfolderName, events_Folder
    on runConversion(theItems)
        activate "Finder"
        set saveFolder to choose folder with prompt "Save resized pictures where?" without multiple selections allowed and invisibles
        tell application "Image Events"
            launch
            set newWidth to 120
            if (count items of theItems) is greater than 0 then
                repeat with anItem in theItems
                    set theName to the name of anItem
                    tell application "Finder" to set myNewFileName to (saveFolder as string) & "tmb_" & theName
                    set imageFile to (open anItem)
                    scale imageFile to size newWidth
                    save imageFile as PNG in file myNewFileName
                    close imageFile
                end repeat
            else
                display dialog "Nothing to convert."
            end if
        end tell
    end runConversion
    mount volume someVolume
    set root_Folder to root_Folder as alias
    set events_Folder to events_Folder as alias
    set theStr to (current date) as string
    set d to date theStr
    set ProcessedfolderName to ((month of d as integer) & "_" & day of d) as text
    tell application "Finder"
        set events_Folder to events_Folder as alias
        set ProcessedfolderName to ((month of d as integer) & "_" & day of d) as text
        set new_FileFolder to make new folder at events_Folder with properties {name:ProcessedfolderName}
        move (every file of events_Folder whose name ends with ".png") to new_FileFolder
        set oldFiles to every file of events_Folder
        set thecount to number of items of oldFiles
    end tell
    set theFiles to choose file with prompt "Choose the files" of type openTypes with multiple selections allowed without invisibles
    runConversion(theFiles)
    activate
    BUT if I modify it to the following, it gets hung up on "scale imageFile to size newWidth"
    error "The variable imageFile is not defined." number -2753 from "imageFile"
    Maybe it has something to do with the line
    'set theFiles to choose file with prompt "Choose the files" of type openTypes with multiple selections allowed without invisibles'
    which is not in the broken script.
    The broken script is as follows:
    property openTypes : {"PDF", "com.adobe.pdf", "BMP", "com.microsoft.bmp", "JPEG", "JPEG2", "jpg", "public.jpeg", "PICT", "com.apple.pict", "PNG", "public.png", "PSD", "com.adobe.photoshop-image", "TIFF", "public.tiff"}
    global eventsFolder, ProcessedfolderName, new_FileFolder, imageFile
    on runConversion(theItems)
        activate "Finder"
        set saveFolder to new_FileFolder
        set theItems to every file of the saveFolder
        tell application "Image Events"
            launch
            set newWidth to 120
            if (count items of theItems) is greater than 0 then
                repeat with anItem in theItems
                    set theName to the name of anItem
                    tell application "Finder" to set myNewFileName to (saveFolder as string) & "tmb_" & theName
                    set imageFile to (open anItem)
                    scale imageFile to size newWidth
                    save imageFile as PNG in file myNewFileName
                    close imageFile
                end repeat
            else
                display dialog "Nothing to convert."
            end if
        end tell
    end runConversion
    mount volume mountVolume
    set root_Folder to rootFolder as alias
    set events_Folder to events_Foler as alias
    set theStr to (current date) as string
    set d to date theStr
    set ProcessedfolderName to ((month of d as integer) & "_" & day of d) as text
    tell application "Finder"
        set ProcessedfolderName to ((month of d as integer) & "_" & day of d) as text
        set new_FileFolder to make new folder at events_Folder with properties {name:ProcessedfolderName}
        move (every file of events_Folder whose name ends with ".png") to new_FileFolder
        set oldFiles to every file of events_Folder
        set thecount to number of items of oldFiles
    end tell
    set theFiles to every file of new_FileFolder
    runConversion(theFiles)
    activate

    Several lines of the “broken” script seem to be badly written, for example:
        set root_Folder to rootFolder as alias -- rootFolder instead of root_Folder
        set events_Folder to events_Foler as alias -- Foler instead of Folder
    Message was edited by: Pierre L.

  • ICal + Exchange 2007 - recurring events issues

    Hi all
    Not sure if this has been brought up before, couldn't find anything on the boards.
    Anyway, our client has 20 macbook pros all running OS 10.6.2. They also have an Exchange 2007 server (previously they had a 2003 exchange server and were using entourage).
    The problem they appear to be having is when creating a recurring event they invite selected users but the invites either don't get through or upon accepting the invite it doesn't show up in the other user's calendar. I've heard there are some issues with iCal and recurring events - is this true or does anyone know a way to fix this?
    Thanks in advance.

    https://developer.apple.com/bugreporter/
    You can also try http://www.apple.com/feedback/macosx.html but I don't think that's as useful.

  • Recurring To Dos and multiplying events from subscribed calendars

    The density and volume of discussion about iCal's recurring ToDos and Events is too overwhelming to survey in its entirety so I will try this new post focussed on my problems.
    My iCal has been starting up (beach ball icon turning) for more than a day, a process that began when I opened the ToDos column (push pin icon at bottom of window). Rightly or wrongly I entered a large number of birthdays and other anniversary dates as ToDos instead of Untimed Events. The bulk of my ToDos are such annually recurring events although there are plenty of others with shorter intervals (like those involving taking the trash out or renewing library books).
    I suspect that it is these recurring ToDos running many years into the future that is preventing iCal from completing its start up and clogging up the application's data capacity. I can force quit the application, but the whole process only "recurs" when I launch the application again. I would happily sacrifice my entire ToDo file (Calendar) and re-enter the information under recurring untimed events, but I cannot figure out how. Moreover, Michael Lafferty wisely cautioned in regard to an iSync post about removing any files in OS 10 from the location where Apple placed them.
    So how can I escape this bewildering and frustrating situation and get back to my more serious problem with using iSync to synch my Zire 71 with iCal on my G4?
    Thanks
    G4 400Mhz   Mac OS X (10.3.9)   another G4 400 Mhz w/ OS 19.3.9, PPC8100AV Mac OS 9.2, Palm Zire 71, Handheld Visor
    G4 400Mhz   Mac OS X (10.3.9)   another G4 400 Mhz w/ OS 19.3.9, PPC8100AV Mac OS 9.2, Palm Zire 71, Handheld Visor

    In another post, information was provided for removing duplicates, one an Applescript its creator supplied for finding and deleting iCal duplicates (called Delete iCal Duplicates) and another a shareware application UnDupe available from the Palm Store or Stevens Creek Software that will find and remove duplicates on a Palm device such as my Zire 71. I used both, finding few duplicates in iCal with the Delete iCal Duplicates Applescript, but a staggering number of duplicate ToDos on my Zire with UnDupe which I removed.
    However, I still am unable to complete a sync with HotSync Manager and iSync because the Conduit Manger fails in mid-sync repeatedly. I am getting in the HotSync log the following message, but iSync continues the syncing process as though nothing has happened. Here is the message:
    Sync type is Fast
    iSync Conduit starting 7.28.06 11:31:23 PM
    Setting Hello Response, type is PalmSyncTypeFast, language is 0
    (BladeLanguageEnglish) 7.28.06 11:33:51 PM
    Timeout waiting for Sync Engine, exiting 7.28.06 11:40:39 PM
    iSync Conduit: received NULL message, disconnecting... 7.28.06 11:40:39
    PM
    iSync Conduit synchronization failed
    “iSync Conduit” failed (error = #-1)
    Do I need to re-install Palm Desktop v4.2.1 to replace a defective Conduit Manager component or what other solution to this repeated failue in mid-sync. Also note as I said that iSync does not stop and report the sync failure but just continues running and cannot be "Cancelled" either. Only a force quite and a complete re-start will stop iSync from continuing the synching process long after HotSync Manager has reported and logged the iSync conduit sync failure. Correction: some 40 minutes after HotSync Manager declared an interruption and failure, iSync has finally stopped with a sync failure alert
    Thanks for help although at this point after 2-3 days no one has responded to my orginal question. Should I have cross-posted to the iSync Forum?
    G4 400Mhz   Mac OS X (10.3.9)   another G4 400 Mhz w/ OS 19.3.9, PPC8100AV Mac OS 9.2, Palm Zire 71, Handheld Visor
    G4 400Mhz   Mac OS X (10.3.9)   another G4 400 Mhz w/ OS 19.3.9, PPC8100AV Mac OS 9.2, Palm Zire 71, Handheld Visor
    G4 400Mhz   Mac OS X (10.3.9)   another G4 400 Mhz w/ OS 19.3.9, PPC8100AV Mac OS 9.2, Palm Zire 71, Handheld Visor

  • My calendar on my iPhone 4 erases all data over a month old except for recurring events.  How Do I get it to keep the info and not erase calendar events?

    My calendar on my iPhone 4 erases all data over a month old except for recurring events.  How Do I get it to keep the info and not erase calendar events?

    Settings>Mail, Contacts, Calendars>Calendars>Sync>All Events.
    Note: If you're using a work Exchange account, the administrator my have restricted your options for this setting.

  • Changes made to recurrent events in ical and/or iphone 4 will not sync since upgrading phone to iOS 5. I have an old macbook pro and it is running snow leopard OS 10.6.8. I have a minimum of 40 recurring events per week, several of which change.

    since upgrading phone to iOS 5. I have an old macbook pro and it is running snow leopard OS 10.6.8. I have a minimum of 40 recurring events per week, several of which change. I use the information to schedule future appointments based on those changes and it's causeing a major problem to not have the changes sync. Any help would be very much appreciated.

    Did you try to replace the calendar info on the phone with the one on your Mac? You can find this option in iTunes/Info pane, Advanced section.

  • When syncing iPod touch to MacBook, I have selected to sync only events newer than 360 days. Yet I get message that sync will change 8000 events on "this computer"  most of which are years old and many are recurring events.  I'm afraid to proceed

    When syncing iPod touch to MacBook, I have selected to sync only events newer than 360 days. Yet I get message that sync will change 8000 events on "this computer"  most of which are years old and many are recurring events.  I'm afraid to proceed with sync. 

    Having the same problem here. As a first time mac user, Apple has certainly made a bad first impression.
    For me, the issue seems to occur when transferring files between computers that are connected to the same access point (when transferring files from wired computers on the network there is no issue). My vista laptop and every laptop I have tried has worked perfectly fine with this access point so I am 100% convinced it is the mac. Basically when I copy the files, after about 100mb, I am unable to access anything on the local network or internet until I restart Airport. The weird thing is that even though I am unable to access anything, the airport utility says it is connected. I might also note that the wireless signal strength is full.
    If I can't get this figured out in a few days, this computer is going back to the store where it came from and I will officially label myself anti-mac. This type of issue is just unacceptable for something so main stream.

  • ICal 3.x .ics import - problem with recurring events and non-unique UIDs

    Upgraded to Leopard over the holiday break. Under Tiger's iCal (v2.x), .ics files exported from other calendar programs (Outlook via iAppoint/O2M in this case) and imported into iCal behaved 'normally'. However, in iCal 3.x in Leopard, for recurring appointments in the exported calendar, only the last appointment in the series shows up in iCal (although some meetings show up for about 0.25 seconds during the calendar import, then immediately disappear! This post by MalcolmS provided the critical clue - it seems that for recurring events, the .ics file has all of the events in the series with the same UID. Previous versions of iCal didn't care, but v3 apparently does - and deletes all earlier versions of the event, leaving only the last one with that UID. I confirmed that is the case by opening the .ics file in Word, which clearly showed all of the recurring events, and all the events in a series (e.g. a weekly meeting for the year) had the same UID. After the import to iCal, only the last one is in the calendar (in the above example, the one meeting of the series occurring in the last week of December). Manually editing the UIDs of a recurring series in the .ics file (to make them actually unique) allows them to all show up in iCal after import.
    Since many of the events in my Outlook calendar are accepted invites for recurring appointments, re-creating them as individual calendar events in Outlook is not a viable option. The frequency of changes to my calendar means I usually export it once per day (or twice); thus, manually editing the .ics files is also not a viable option.
    Any suggestions on workarounds for this problem? Alternatively, any other suggestions for getting the calendar data from Outlook into iCal?
    Thanks in advance!

    Moot point, as direct iPhone access to the Exchange server is now supported by our IT department.

  • Calendar View: Unable filter Recurring Event by Start/End Time and Group by Recurring Event View

    Hi All,
    I have just found several issues with Calendar View from WSS 3.0:
    Unable to filter by [Start Time] and [End Time]
    I am not sure why these 2 columns doesn't appear in the Filtering column in the View Settings. The workaround found in the internet is to create calculated column for Start Time and and End Time. However, it doesn't work for Recurring Event, the calculated column will show only first recurring event Start Time.
    Unable to use "Group By"
    When I create new view in Calendar using format: "Standard View, with Expanding Recurring Events", there is no option to specify "Group By". Anyone knows how to show all recurring event in List view and grouped by Start Time (or any other column).
    Thank you and apprecate for any idea.

    Hello,
    I got this from a colleague of mine so I can't take credit for it but here might be a possible workaround:
    1. Create two new Columns called Start Filter and End Filter.  Make these columns Calculated Columns with formulas of [Start Time] and [End Time] respectively.  The columns should be of the Date and Time\Date and Time type and should not be displayed on the Default View.
    2. Click Advanced Settings and choose Yes to the question "Allow management of Content Types" in the Content Types section.  Click OK.
    3. Click on the Event Content Type.  Open the two columns created in step 1 and select "hidden" for both of them.  Click OK.
    4. Back at the list settings create a new view or edit an existing view.  When you get to the filter section choose "Show items only when the following is true" and select the following:
    Start Filter
    is less than or equal to
    [Today]
    And
    End Filter
    is greater than or equal to
    [Today]
    5. Click OK to save the view.
    6. Open the List view web part that is displaying the recently changed calendar and change the view to the newly created or newly edited view.  Click Apply, OK.
    -Aseem Nayar
    This posting is provided "AS IS" with no warranties, and confers no rights

  • Lightning 1.0 recurent event and Communications Synchronization Engine

    Hello,
    We have noticed that lightning 1.0 does add interval value
    when it is 1.
    Then our synchronica gateway does not sync recurrent
    events.
    Could someone test it with Communications Synchronization Engine
    to tell me if there is also the problem?
    Examples used to reproduce the problem:
    BEGIN:VEVENT
    UID:000000000000000000000000000000004a6827d300007cc100000b350000359b
    DTSTAMP:20090723T090842Z
    SUMMARY:RecurTest1.0
    DTSTART;VALUE=DATE:20090724
    DTEND;VALUE=DATE:20090725
    CREATED:20090723T090524Z
    LAST-MODIFIED:20090723T090524Z
    PRIORITY:0
    SEQUENCE:0
    CLASS:PUBLIC
    ORGANIZER;CN="Roger MERAT"
    ;[email protected]
    :merat
    STATUS:CONFIRMED
    TRANSP:TRANSPARENT
    RRULE:FREQ=YEARLY;BYMONTHDAY=24;BYMONTH=7
    X-NSCP-ORIGINAL-DTSTART:20090723T220000Z
    X-NSCP-LANGUAGE:fr
    X-NSCP-DTSTART-TZID:Europe/Paris
    X-NSCP-TOMBSTONE:0
    X-NSCP-ONGOING:0
    X-NSCP-ORGANIZER-EMAIL:[email protected]
    X-NSCP-GSE-COMPONENT-STATE;X-NSCP-GSE-COMMENT="PUBLISH-COMPLETED":65538
    END:VEVENT
    BEGIN:VEVENT
    UID:000000000000000000000000000000004a6827580000083400000c420000359c
    DTSTAMP:20090723T090842Z
    SUMMARY:RecurTest0.9
    DTSTART;VALUE=DATE:20090723
    DTEND;VALUE=DATE:20090724
    CREATED:20090723T090320Z
    LAST-MODIFIED:20090723T090320Z
    PRIORITY:0
    SEQUENCE:0
    CLASS:PUBLIC
    ORGANIZER;CN="Roger MERAT"
    ;[email protected]
    :merat
    STATUS:CONFIRMED
    TRANSP:OPAQUE
    RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTHDAY=23;BYMONTH=7
    X-NSCP-ORIGINAL-DTSTART:20090722T220000Z
    X-NSCP-LANGUAGE:fr
    X-NSCP-DTSTART-TZID:Europe/Paris
    X-NSCP-TOMBSTONE:0
    X-NSCP-ONGOING:0
    X-NSCP-ORGANIZER-EMAIL:[email protected]
    X-NSCP-GSE-COMPONENT-STATE;X-NSCP-GSE-COMMENT="PUBLISH-COMPLETED":65538
    END:VEVENT
    When the interval is not set, synchronica will not sync the recurent event
    although it should be ok:
    chapter "4.3.10 Recurrence Rule" de http://www.ietf.org/rfc/rfc2445.txt :
    The INTERVAL rule part contains a positive integer representing how
    often the recurrence rule repeats. The default value is "1", meaning
    every second for a SECONDLY rule, or every minute for a MINUTELY
    rule, every hour for an HOURLY rule, every day for a DAILY rule,
    every week for a WEEKLY rule, every month for a MONTHLY rule and
    every year for a YEARLY rule.

    shjorth wrote:
    There is a documented known limitation in the release notes that appears to relate to the scenario you have described:
    http://wikis.sun.com/display/CommSuite/Sun+Java+Mobile+Communications+1+Release+Notes
    "If a single occurrence of a recurring event is changed the change is ignored."Hello Shane,
    I also know this limitation as we (University of Geneva)
    had reported it one year ago.
    But this is a new bug which is much worse.
    Basically, what happens with lightning 1.0 is that
    all new recurrent events are synchronized
    as a non recurrent event because lightning creates
    the event differently without providing an OPTIONAL parameter
    and while respecting the ical RFC.
    There are no log to provide, the bug is easy to reproduce.
    You just create an event (eg daily).
    You export the calendar.
    You remove the INTERVAL parameter in it as
    the RFC said it is optional and has a default value of one.
    You import this event.
    You sync.
    You have the bug.
    Or you just install lightning 1.0, create an recurrent event
    and sync.
    From what I have been told by mozilla developers
    the bug is not limited to lightning but all applications
    that uses a new version of libical (like evolution).
    Users have not yet met the bug because lightning 1.0
    is still in beta. But when it would be available it is
    going to be a very bad news.
    Regards,

  • How To Expand And Display Recurring Events In Content Search Web Part?

    I have a requirement to display all upcoming events. So I used content search webpart to display all the events, however the only problem is that I'm unable to expand recurring events all together. Is there a way to do this?
    Vamsi Munagala

    Hi Vamsi,
    Per my knowledge, where is no OOB method to achieve your requirement.
    As a workaround, we can customize a web part to achieve it, querying Recurring Events using CAML Query and display the results in a SPGridView.
    https://jtheblog.wordpress.com/2011/08/10/sharepoint-caml-for-calendar-recurring-events/
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • TS3569 On my iPad 2, one particular recurring event keeps duplicating itself. I delete the duplicate and it reappears a day later. Help.

    On my iPad 2, one particular recurring event keeps duplicating itself. I delete the duplicate and it reappears a day later. Help.

    Do you use MobileMe and an iPhone? If yes, do this in the following order:
    Mac:
    (1) back up the applications giving you problems
    iPhone
    (1) Open settings, then open "mail, contacts, calendars"
    (2) Open .Mac account
    (3) Turn OFF the applications that are causing problems
    (4) When you turn off on of the applicatios, a red sign "stop syncing" will appear. Press it. A msg will appear "turning off xxx"
    (5) Get out of settings
    (6) Don't do anything for about 20 mins. Don't touch your iPhone or your Mac. (syncing needs time to settle down)
    After 20 minutes...
    Mac:
    (1) Open each application that is giving you problems. Fix errors. Back up.
    (2) Do this for each application
    iPhone
    (1) Open settings, then open "mail, contacts, calendars"
    (2) Open .Mac account
    (3) Slide switch to ON for each app you turned off; there won't be a msg
    (4) Get out of settings
    (5) Via MobileMe, syncing will start again.
    Wait about 20 minutes, again. You should see all in order after that. At least, that was my experience.

Maybe you are looking for