Benches macOS

3

Moving events from one iCal calendar to a…

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

Can anyone shed some light on why the following does not work?

tell application "iCal"

set allEvents to events of calendar "Home"

set t to events of calendar "[email protected]"

repeat with theEvent in allEvents

move theEvent to end of t

end repeat

end tell

I am trying to move all events from one calendar to another....

Any help much appreciated.

iCal 4.0.1, Mac OS X 10.6.2

3 replies

Sign in or join Beachball Help to reply.

  1. 0

    red_menace

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Your list variable
    t is assigned the events of your second calendar, but you are just adding items to the end of that list. Try moving the items to the actual calendar instead:

    <pre style="

    font-family: Monaco, 'Courier New', Courier, monospace;

    font-size: 10px;

    font-weight: normal;

    margin: 0px;

    padding: 5px;

    border: 1px solid #000000;

    width: 720px;

    color: #000000;

    background-color: #DAFFB6;

    overflow: auto;"

    title="this text can be pasted into the AppleScript Editor">

    tell application "iCal"

    repeat with anEvent in (get events of calendar "Home")

    move anEvent to (end of events of calendar "[email protected]")

    end repeat

    end tell

    </pre>

  2. 0

    hubionmac

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    this seem to work. I had to de-activate & activate the calendar I copied to after the script was finished

    tell application "iCal"

    set allEvents to events of calendar "A"

    repeat with theEvent in allEvents

    copy theEvent to end of events of calendar "B"

    delete theEvent

    end repeat

    end tell

  3. 0

    myitcv

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Fantastic - thanks for both of these answers