Moving events in iCal

Hi,
I have some events that I would like to move forwards in time by one year. I have an applescript that seems to work on trial data, but when I use it on the real data I get an error message " summary is not defined" Can anyone tell me where I might be going wrong?
THe script I'm using is below.
Many thanks.
Petertb
tell application "iCal"
set allEvents to every event in calendar "untitled"
repeat with theEvent in allEvents
if start date of theEvent is date "Thursday, October 23, 2008 12:00:0 AM" then
set theSummary to summary of theEvent
set newStartDate to (start date of theEvent) + 365 * days
set newEndDate to (end date of theEvent) + 365 * days
set newLocation to location of theEvent
end if
tell application "iCal"
tell calendar "test2"
-- set theCurrentDate to current date
make new event at end with properties {summary:theSummary, start date:newStartDate, end date:newEndDate}
end tell
end tell
end repeat
end tell

On reflection I see whats happening. You are looping through the events, then have an 'if…then' block. You finish that if block before you make the event, so the variables haven't been set if the event isn't on that date.
Move the 'end if' line to after the second to last 'end tell' line and it'll work. You also don't need the second 'tell application "iCal"' line (or associated 'end tell') as you are already in a tell block for iCal.
I hope you find this useful.
Best wishes
John M

Similar Messages

  • Duplicated events on iCal after moving to iCloud

    Hi, i just updated mi iphone 4 to iOS5, then updated iTunes, then updated OSX Lion to 10.7.2, then moved to icloud...
    Everything seems to be ok, but there's a problem: my events duplicated on iCal in my macbookpro...
    Every input has cloned itself!
    But, when checking on icloud and on my iphone, no duplicates!
    So... what should i do?, 'cause if i delete a duplicated event from iCal in my computer, leaving only one, the event erases at all in iCloud and in my iPhone...
    Weird.
    Any suggestions?
    I appreciate your time, thank you!

    Hi Jorge. I just went through this entire process. I was able to rid myself of duplicates, however, I am still trying to figure out how to match a hard copy to my Mac without creating duplicates.
    - Make sure you have your events on the Mac
    - Go to iCloud on phone and turn off iCloud on everything (for now). It will tell you it will delete everything off iCloud (this is fine if you have everything you need on your Mac).
    - Go into iTunes on Mac and "turn of Sync with this iPhone over Wi-fi" & check "back up to this computer"
    -Go to info tab in iTunes on Mac. Check sync "contacts" & sync "calendars"
    - While you are in the info tab also check "calendars" & "contacts" in the Replace Information on This iPhone section under Advanced.
    - Synch
    - If everything matches up properly go back to iPhone and turn iCloud back on for what you want
    - Go to iCal on Mac and in the top left hand corner there is a "calendar" button that when you click it, it shows calendars for "On my Mac" and "iCloud".
    - You can delete the "On my Mac" calendars to rid yourself of the duplicates.
    ***This is how I did it. You may be able to just delete the "On my Mac" calendars but I am not sure if that will take them off of iCloud and your iPhone. You can give it a try first as it may be less time consuming.
    So, my issue is still trying to figure out how to keep matching calendars as a backup on Mac without the duplicates. Any takers?

  • ICal Randomly moving events - BAD

    I have a good friend who just missed a flight by a day because iCal keeps automatically & randomly moving events on her iCal.
    iCal is current and up to date. She doesn't use MobileMe to Sync. She does have an iPhone but Syncs manually only once in awhile. She's on Leopard.
    She does fly around a lot and is constantly changing time-zones & thus she changes the time on her computer a lot.
    "For instance - if I type something for Monday while in Chicago - and then when I go to Delhi - it is listed as Tuesday because of the time diff?
    But I cannot imagine why it would not flop back when I returned to Chicago - and most of my travel during the i-cal changes has been domestic - which has no more than a 3 hour time change"

    I have exactly the same problem!!
    It drives me nuts. I create an event, maybe move it around once or twice, then iCal keeps moving for me.
    I try quitting and restarting, refreshing all calendars etc... but no luck. I also think iCal is not very good with it's integration with Exchange servers. I accept invitations to events but the status is not updated, etc.

  • When I try entering a new event in iCal on my MacBook Air, I get an error message popping up on my screen that says: The request for account "iCloud" failed.  The server responded with "502" to operation CalDAVSetPropertyQueueableOperation. Help!!??

    When I try entering a new event in iCal on my MacBook Air, I get an error message popping up on my screen that says:
    The server responded with “502”
    The request for account “iCloud” failed. 
    The server responded with “502” to operation CalDAVSetPropertyQueueableOperation.
    The request for account “iCloud” failed.
    I am then given the option of staying Online or going Offline.
    Can anyone help me?
    thanks

    Hello b.krushel,
    Thank you for using Apple Support Communities
    Any number of things could cause this issue, so I would recommend this article named iCloud: Troubleshooting iCloud Calendar found here http://support.apple.com/kb/TS3999.
    These sections in particular:
    General Troubleshooting
    Make sure there are no current issues listed on the System Status that affect iCloud Calendar. The System Status is located on the iCloud Support webpage.
    Make sure you have fully enabled iCloud Calendar for the client you are using (for more setup and troubleshooting information on iOS, OS X, Windows and iCloud.com, see the additional details below).
    Check to see if the issue you are seeing is covered in iCloud Help. To search iCloud Help, visit help.apple.com/icloud.
    Check your settings and preferences as something may not be set up correctly. For example, having incorrect date and time settings can cause issues which are easily resolved by entering the appropriate settings.
    Troubleshooting Calendar on OS X Mountain Lion (iCal on OS X Lion)Note: For instructions on setting up iCloud Calendar with Calendar or iCal on your Mac, see iCloud Setup.If you are having trouble with Calendar or iCal on a Mac and you are using iCloud Calendar, try each of these steps, testing after each to see if the issue is resolved:
    Make sure you are using OS X Lion v10.7.2 or later. Click here for help verifying the version of OS X you are using.
    Make sure your computer is online. Attempt to view www.apple.com and iCloud.com. If you can't connect to the Internet, your iCloud calendars and events will not update in iCal. Click here for more information about troubleshooting your Internet connection.
    Verify that your iCloud member name is entered into the iCloud Preference pane in System Preferences. See iCloud Setup for more information about setting up iCloud on a Mac.
    Make sure you enter and update calendar information in the iCloud section of Calendar or iCal. Only calendars and events in the iCloud section of the Calendar or iCal Calendar list will be pushed to iCloud. Both Calendar and iCal for the Mac support the display of and interaction with multiple accounts and datastores, for example, iCloud, On My Mac, Exchange, Google, and so on. This makes it easy to create or modify events or calendars in a section of  Calendar or iCal that may not be updating iCloud. Learn more about moving local calendars to iCloud.
    In some cases, you may find that you have data duplicated in both the local On My Mac and the iCloud sections of Calendar or iCal. Learn more about resolving this issue.
    You can make the iCloud calendar your default calendar for all new events. In Calendar on OS X Mountain Lion, choose Calendar > Preferences > General, or in OS X Lion, choose iCal > Preferences > Generaland under the Default Calendar heading, select one of the Calendars under the iCloud heading. Close the Preferences window to save this change.
    If recent changes simply don't appear, try forcing Calendar or iCal to refresh by selecting Refresh All from theCalendar menu.
    Make sure your account was successfully created in Calendar on your Mac (or iCal). After upgrading to iCloud Calendar, you may need to quit and reopen Calendar (or iCal). To confirm your account is configured correctly in iCal:
    Open Calendar (or iCal).
    Open Calendar (or iCal) Preferences.
    Click Accounts. You should see an account with your iCloud member name entered.
    Turn iCloud Calendars off and back on
    Quit Calendar (or iCal).
    Choose Apple () menu > System Preferences > iCloud.
    Remove the checkmark in the checkbox next to Calendars.
    Close System Preferences and wait about a minute.
    Open System Preferences and choose iCloud.
    Replace the checkmark next to Calendars.
    Close System Preferences.
    Open Calendar (or iCal) and test to see if the issue has been resolved.
    Restart your computer. This may sound simple, but it does reinitialize your network and application settings and can frequently resolve issues.
    Take care,
    Sterling

  • Updated event in iCal - but responses from invitees deleted the event

    I recently updated an event in iCal (changed the date). The updated event was sent to invitees. Unfortunately, when invitees responded, I got responses back in "Notifications" that the event had been canceled. I hadn't actually canceled the event - just moved it to the new date.
    When I clicked on "Ok" in the Notifications (to try and clear out notifications on my iCal), it ACTUALLY canceled the event and sent out the cancellation notice to all of the invitees.
    I've experienced this behavior several times - I update the event, but get responses back in Notifications that the event has been canceled. When I actually "accept"/"Ok" the Notification, it then cancels the event and sends out a cancellation notification.
    Is this expected behavior? Is there a workaround? Any help is greatly appreciated!

    Embarassed at how easy this is. Type in the name under Location, and it links immediately to the person's address from Contacts.

  • Anyone else unable to edit gCal events via iCal?

    Ok, I can create events in iCal for a gCal and it will update universally across all devices (iMac, iPhone, iPadm, and on gCal). Not having any issues with this part of syncing. All events are present on all devices as well. The issue I seem to be running into is editing those events, specifically the notes section. I like to add in assignments that are due in the Notes section and it seems recently that this is very hit or miss and more on the miss end. As of today, 3/19 I haven't been able to succesfully edit the Notes of any of my current events. Very frustrating to say the least. Any insight into this would be much appreciated.

    For the last few weeks, I'd been having problems with my gCal/iCal sync, including editing events in iCal.  I gave up and moved everything back to iCal and I am now using iCloud.  In my search for an answer, I came across a great read:  http://www.busymac.com/download/tco-busycal.pdf
    It was written for a third party app but has a lot of good information in it.
    Hope that helps,
    Rhonda

  • Why do i have 2 entries for the same event in iCal?

    I have just upgraded to OS Lion, purchased an iPhone 4S and have also moved to iColuds - why do I have 2 entries for all my events in iCal?

    You can just delete the ones you don't want from the document Library. Be careful though, that you do not delete the symbol(s) that are being used on the canvas.
    It's hard to say how you got so many duplicates in the first place without knowing your workflow.
    My guess is that you created a new symbol every time you added something to the canvas, but that is only a guess.
    HTH
    Jim

  • Is i possible to trigger a workflow from the creation of an event in iCal

    Is i possible to trigger a workflow from the creation of an event in iCal
    Or is is possible to create a workflow to ad events to an iCal calendar which then triggers the workflow or is combined with the ad events workflow.
    Graeme

    Hmm, nope. Not that I'm aware of. Very few apps allow you to hook scripts directly to user activity. Finder* is a notable exception. iCal's "publish" feature has the ability to auto-update after user activity, but you'll either need dot mac accounts or your own webdav server to get that working.
    I'd re-consider the idea of triggering a periodic workflow with iCal. That way if the computer is shut down or asleep, iCal will wait to run the workflow at its next opportunity. You could hide the unsightly repeating events in a second calendar so they're out of the way.
    The next best thing is to write a faceless AppleScript application with a long-duration idle handler. The user would simply add it to their login items in System Preferences. This would also resume its cycle after sleep or shutdown.
    Yet another option is to write an AppleScript that can register itself in the crontab. This has the advantage of running at a predictable time. If you're careful, you can even set the script to wake up or power on the computer as necessary.
    * Folder action scripts can be triggered when files are created, moved, or deleted, but not when they're merely updated. This probably rules out much of iCal's activities in ~/library/application support/ical/.

  • HOW CAN INVITE PEOPLE IN A GROU EVENT ON ICAL WITHOUT THEM SEE EACH OTHER EMAIL ADDRESS

    HOW CAN INVITE PEOPLE IN A GROU EVENT ON ICAL WITHOUT THEM SEE EACH OTHER EMAIL ADDRESS ?

    Hi, I never use any of these, but according to this it uses eMal, so I'd think moving the adressees to the BCC: field should do it.
    Not the To: or CC: feild.

  • Does anyone know if I can number repeat events in iCal?

    Hello
    I am trying to number recurring events in iCal. I run language courses and I want to be able to number the lessons, so I can see at a glance what number we are on. Is there a way I can do this and set it that iCal will update the number when an event gets cancelled/moved.
    Thanks for your ideas!

    Maybe late for this answer but hope it helps, I had no service on my Iphone4 in the Bahamas even after adding a 5 dollar unlimited text package. This was Valentines Day weekend and we had NO SERVICE whatsoever. Verizon just confirmed that the network trouble in the Bahamas had been previously documented. My question is how was there broken coordination with an entire country that is updating it's network not compensating/preparing for it? The chaos that ensued from 3 family parties arriving at different times, having no cell service was not pleasant. We literally had to use email on local hotel wifi thru to communicate. Verizon's answer was that we should've run *228 to update but pointed out this was no guarantee that the networking issue would be solved. Whatever the reason, this is unacceptable for the amount we all pay each month. Having been a Verizon supporter for many years, I was very disappointed during this meaningful family event not being able to depend on my phone service. Please check ahead for alerts before you go!!

  • How can I hide a single event in iCal?

    I'd like to be able to mark the occasional event in iCal private, or hidden from view, but everything else visible. Is this possible?

    I agree, I can post a calendar from Outlook 2007 to my corporate iCal Server marking items as private and thus anyone subscribing to my calendar won't see what the appointment is - only that I have something in my schedule. It'd be something awesome if the Apple iCal could be able to do the same thing.

  • Linking multiple emails to a single event in ical and/or to do's

    Hi:
    Often I receive emails and I want to link them to an event in ical. OS X does this just fine as long as there is date in the email that OS X can recognize. The problem is sometimes I get multiple emails relating to the same event and I would like to be able to link all of those emails to one single event in ical. My same questions applies to 'to do' items.
    And a follow up question--say I receive an email that has no date explicit in the text-I've tried to find some function that would allow me to schedule a new event in ical and would link that email to it. (I hope that all makes sense) I'm open to whatever solution I'll even pay money for 3rd party software if anyone knows of a good program. But I"m looking to stick to the basic ical interface. Any suggestions?

    Hi rtwigg,
    seems this is one of visio graphics limitation regarding the external data.
    visio graphics, may only support for one row.
    you may consider this idea :
    "It is a good idea to separate your rows into visual units so that you have everything you need and nothing else in a single row. To link a shape to a data row, simply drag the row from the external data window and drop it on the shape. A default data
    graphic should immediately appear next to the shape displaying some data from the row. From here you are able to customize the graphic to fit your needs"
    by means, you may need to use the visio client.
    http://blogs.msdn.com/b/visio/archive/2010/02/05/no-code-mashups-with-visio-services-and-web-part-connections.aspx
    http://msdn.microsoft.com/en-us/library/ff408345.aspx
    http://msdn.microsoft.com/en-us/library/ff394649.aspx
    http://blogs.msdn.com/b/visio/archive/2010/02/21/the-visio-services-javascript-mashup-api.aspx
    Regards,
    Aries
    Microsoft Online Community Support
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • Deleting a single event in ical

    I have a regular event in ical that is in every weekend.  As other things crop up i delete it if im not goign to be able to do that particular event.  It has worked well on my phone and ical.  But today i decided to delete the even through my icloud calendar -- and it has deleted the complete series, right from where it started.
    Another Lion/cloud glitch?
    really annoying that i cant get these dates back.

    Make sure you select/highlight the actual item, not just the day or time, and then hit delete.
    Cheers
    Rod
    Message was edited by: Rod Hagen

  • When I try to create a new event in iCal on my iPod Touch I cannot select "done" or "cancel" to save it?

    However when I sync my Mac and my iPod it will show up fine on my Mac. It just drives me crazy and if I had to create more than one event in iCal I probably couldn't. Any fix to this? Thanks.

    You can not add events to the birthday's calendar. To add birthday's to the birthday calendar you need to add the birthday to a contact in the Contacts app.
    You can set your default calendar here:
    iCal > Preferences > General  > Default Calendar and chose the calendar you want to default to.

  • How do I select multiple events in iCal 8.0?

    In OSX Mavericks, I used to be able to select multiple events in iCal in the event list view. I could select the initial event in the span of events to be selected. Then hold Shift while selecting the final even in the span of events. As a result, all of the events in that span would be selected.
    in OSX Yosemite, this is no longer possible. There appears to be no list view, and holding the Shift button does not allow me to select a span of events.
    What is the best way to select a span of events, say as much as 30 events?
    Thank you.

    Empty Caches
    1. Safari > Preference > Advanced
        Checkmark the box for "Show Develop menu in menu bar".
        "Develop" menu will appear in the Safari menu bar.
        Click Develop and select "Empty Caches" from the dropdown.
    2. Quit Safari if open.
        Option click the "Go" menu in the Finder menu bar.
        Select "Library" and then "Caches".
        Look for the folder 'com.apple.Safari"
        Right click "com.apple.Safari" and select "Move to Trash"
        Relaunch Safari.

Maybe you are looking for

  • Unable to get RequestDispatcher for Context

    Eclipse 3.3.0 Tomcat 6.0.16 Java 1.5.0_13 Mac OS X 10.5.6 Greetings: I'm attempting to retrieve information cross context in my web application. I've attempted to enable cross context access by three means. - I've added "crossContext=true" to the <Co

  • P_GROUP Field in S_DEVELP Object?

    Hi Experts, When user needs a S_DEVELOP Object,provides the SU53 with P_Group as <dummy>.We also provides the user with S_Develop with P_GROUP as blank.Even P_GROUP field is blank, user is able to work.Then what is the purpose of P_Group field in S_D

  • Can't View More than 1 Calendar at a time

    Hi, Just got my first mac since 1992, and starting tofigure it all out.  iCal is giving me a headache.  It looks NOTHING like any of the screenshots I've seen from Apple... first off it's got goldmenus, not system default colors.  (iCal 5 in Lion). I

  • IPod won't sync after restore - Please Help!!!

    Hello, Thanks for taking the time to read my posting. I have a 3rd Gen 40gb iPod which was running the 2.2 firmware on Windows XP, which has been fine up until recently. The songs started to randomly skip during playback; this went on for a few weeks

  • Satellite C850-1j1 does not boot anymore

    my laptop Satellite C850-1j1 doesn't boot anymore. Happened after partition changes. shows a error screen telling me the computer needs to be repaired using recoverymedia, I've got a working hirens boot cd and usb (tested on other comp.) but the lapt