AppleScript to make All-Day Events?

I'm new at this, so forgive the question if it's obvious. I routinely import a calendar using Outlook2Cal from a Windows machine to iCal 2.0.3 on my PowerBook. It works fine, but All-Day events in Outlook show up in iCal as starting at 12:00 AM the first day and ending 12:00 AM the next day.
The company that makes Outlook2Mac says that's a bug that they hope will be fixed eventually.
In the meantime, is there a way AppleScript could find all the entries that, say, start at 12:00 AM and automatically check off the "All-Day Event" button?

Hi Roger,
This is fairly straighforward in Applescript. You could try something like the script below. Depending on the number of events in the calendar it's possible this could take time. The script should let you know when it's done.
Just in case you don't like the result. Backup, just in case. In iCal go to File>Back up Database... and save your calendars.
--Copy blue text into Script Editor (Applications > Applescript > Script Editor) , press Run and follow prompts. If you are happy with the results you could save it as an Application.
tell application "iCal"
-- Select calendar
set myCal to first calendar whose title is (item 1 of (choose from list (title of (every calendar) as list) with prompt "Choose calendar"))
-- Loop through events
repeat with myEvt in events of myCal
-- Get start & end times of event
set {startTime, endTime} to {start date of myEvt, end date of myEvt}
-- Check start and end hours & mins
set hoursAndMins to {hours of startTime, minutes of startTime, hours of endTime, minutes of endTime}
-- See if start and end time are midnight, if so set to all day.
if hoursAndMins is equal to {0, 0, 0, 0} then set allday event of myEvt to true
end repeat
display dialog "Done all day events"
end tell
Best wishes
John

Similar Messages

  • Converted Outlook to iCal - All day events messed up

    I converted Outlook calendar via O2M and imported it into iCal on iMac.  The all-day events are blocking up time from 12:00am to 12:00am rather than appearing in the all-day box at the top of the day.  When I click on the event, the "Make All-Day Event" selection is grayed out and I cannot select it.  The events are blocking up and crowding my calendar and I can't see anything.  I don't want to delete and re-enter all events. Just bought the iMac a week ago. What's the fix?

    Found this on another topic and it fixed my problem:
    Re: AppleScript to make All-Day Events? 
    Feb 2, 2006 1:28 AM (in response to Roger Barre)
    Hi Roger, This is fairly straighforward in Applescript. You could try something like the script below. Depending on the number of events in the calendar it's possible this could take time. The script should let you know when it's done. Just in case you don't like the result. Backup, just in case. In iCal go to File>Back up Database... and save your calendars. --Copy blue text into Script Editor (Applications > Applescript > Script Editor) , press Run and follow prompts. If you are happy with the results you could save it as an Application. 
    tell application "iCal"
    -- Select calendar
    set myCal to first calendar whose title is (item 1 of (choose from list (title of (every calendar) as list) with prompt "Choose calendar"))
    -- Loop through events
    repeat with myEvt in events of myCal
    -- Get start & end times of event
    set {startTime, endTime} to {start date of myEvt, end date of myEvt}
    -- Check start and end hours & mins
    set hoursAndMins to {hours of startTime, minutes of startTime, hours of endTime, minutes of endTime}
    -- See if start and end time are midnight, if so set to all day.
    if hoursAndMins is equal to {0, 0, 0, 0} then set allday event of myEvt to true
    end repeat
    display dialog "Done all day events"
    end tell Best wishes John 
    Mac OS X (10.4.4)

  • Nokia and iCal: all-day events

    Whenever I use iSync to sync iCal and my E65, all-day events are sent to the phone as "meetings" that last from from 12:00am to 11:59pm instead of being synced as "notes". This is very annoying! Does anyone know of a solution? Here are my software versions:
    Mac OS X: 10.4.10
    iSync: 2.4
    iCal: 2.0.5

    I researched and researched, and it looks like Mac users are out of luck on this issue. Everything seemed to go wrong when Nokia changed to SyncML to sync their calendar and address book databases. Seems like Nokia & Apple would have resolved this issue by now. From what I've heard, it's been a problem for a long time.
    So, I'm giving up for now until someone has an answer. I'm only going to put calendar events on my phone and just use that as my main calendar.
    If anyone's interested, there is new software for S60 called "Handy Calendar" by Epocware. It is an amazing replacement for the built-in Nokia calendar app. The one big improvement is that you can make all-day events repeat, unlike on Nokia's calendar. It uses the same database as Nokia's calendar, so you can switch between the 2 with no problems. It also has a nice, clean, good-looking interface. Unfortunately it uses Nokia's SyncML as well, so it doesn't help with iCal.
    Oh, well... waiting for a fix...

  • E65 and iCal: all-day events

    Whenever I use iSync to sync iCal and my E65, all-day events are sent to the phone as "meetings" that last from from 12:00am to 11:59pm instead of being synced as "notes". I've tried everything I can think of, including syncing to Google Calendars online instead. I get the same issue. This is very annoying! Does anyone know of a solution? Or does anyone know of a different calendar program I can use?
    Here are my software versions:
    Mac OS X: 10.4.10
    iSync: 2.4
    iCal: 2.0.5
    E65: 2.0633.65.01

    I researched and researched, and it looks like Mac users are out of luck on this issue. Everything seemed to go wrong when Nokia changed to SyncML to sync their calendar and address book databases. Seems like Nokia & Apple would have resolved this issue by now. From what I've heard, it's been a problem for a long time.
    So, I'm giving up for now until someone has an answer. I'm only going to put calendar events on my phone and just use that as my main calendar.
    If anyone's interested, there is new software for S60 called "Handy Calendar" by Epocware. It is an amazing replacement for the built-in Nokia calendar app. The one big improvement is that you can make all-day events repeat, unlike on Nokia's calendar. It uses the same database as Nokia's calendar, so you can switch between the 2 with no problems. It also has a nice, clean, good-looking interface. Unfortunately it uses Nokia's SyncML as well, so it doesn't help with iCal.
    Oh, well... waiting for a fix...

  • Printing, including all day events... & changing page setup

    I publish, for print, our school district calendar.
    can I:
    make all day events print, completely? and not just the first line?
    change the page setup? (Printing horizontially... one month 1/2 on one page, the 2nd 1/2 on the other?)
    iBook G4 Mac OS X (10.4.6)
    iBook G4   Mac OS X (10.4.6)  

    I am in the IT department and a fellow coworker is having the same issue. Unfortunely, I had to tell him to use Entourage for now, because when you print a month view from there it will expand all day events. I wish Apple had a fix for this, as it used to print just fine in 10.3 Panther.
    Does anyone have a fix?

  • Adding all day events using applescript to ical

    Hey all. I am new to using applescript. Thanks to some top users i have been able to get excel events file transfered into ical.
    I need help with the applescript for changing these events from time duration to all day.
    tried
    set the start time to 00:00 and end time to 24:00 and
    set all-day to true
    any help would be greatly appreciated!!
    thanks.

    I have the exact same problem. I have entered birthdays for people I know starting with the year of their birth and never ending, an all-day event. They now don't show in 2007, but there is a detached event on January 1, 2000. When I delete that event and all subsequent versions of it, the initial event now ends in 2006 or 2007, and I have to set the repeat to end Never again. I fixed all the ones from February that showed up. Now I notice that a huge amount of the other birthdays (all day events) that I have entered are doing it now, and we are talking well over 40 of them. I don't understand why it keeps creating these detached events. I also publish my calendars, if that makes any difference.

  • To-Do as All Day Event

    Hi,
    Is there any possible way to make an Applescript that automatically copies your To-Do items and then creates an All-Day event for each of them? This is really handy for viewing To-Do items with due dates from an iPod's interface.
    Thanks,
    Harrison

    This might do the job. It makes a new event from any ToDo with a due date and deletes the ToDo. I have added a line to make the new event an all day event but this extra has NOT been tested.
    AK
    click here to open this script in your editor<pre style="font-family: 'Monaco', 'Courier New', Courier, monospace; overflow:auto; color: #222; background: #DDD; padding: 0.2em; font-size: 10px; width:400px">(* Convert ToDos with due dates to Events 
    AK IT Carlow May 2006 
    Sep 2007 - added line to make the new event all day*)
    tell application "iCal"
    set CalList to name of every calendar
    repeat with ThisCal in CalList
    set SomeTasks to todos of calendar ThisCal
    set SomeTasks to reverse of SomeTasks --otherwise delete causes problems
    repeat with ThisTask in SomeTasks
    try
    set DoItOn to (due date of ThisTask) + 3 * days --fails if no date
    tell calendar ThisCal
    set ThisEvent to make new event at end of events
    set summary of ThisEvent to summary of ThisTask
    set start date of ThisEvent to due date of ThisTask
    if (count of (description of ThisTask)) is not 0 then set description of ThisEvent to description of ThisTask
    if (count of (url of ThisTask)) is not 0 then set url of ThisEvent to (url of ThisTask) as text
    set allday event of ThisEvent to true
    delete ThisTask
    end tell
    end try
    end repeat --ThisTask in SomeTasks
    end repeat --ThisCal in CalList
    end tell</pre>

  • Birthday not as all day event

    how can I make birthdays NOT look like all day events? so that I can set an alarm at whatever time I prefer
    how can I set a reminder for an all day event? does it have to go off at midnight?

    You cannot, because by definition, the Birthdays calendar created in iCal and driven by data entered in the Address Book is a read-only object. You cannot modify it.
    You can avoid this problem by turning off this feature and instead using MenuCalendarClock for iCal from objectpark software. The registered version allows batch updates of data in the Address Book birthdays data field, and a generalized, configurable alarm option.
    If you want more flexibility, you will have to create recurring records manually in iCal with individual alarms, or import the data using AppleScript.

  • In ICal is there a way to see all of the text in all day events on the month view of the calendar.  Seems to wrap text only if there is a time on the event

    In ICal is there a way to see all of the text in all day events on the month view of the calendar?  Seems to wrap text only if there is a time on the event

    The paths won't agree on the two OSs so a simple XML import isn't likely to work.
    See Sync iPod/iPad/iPhone with two computers and, if needed, Make a split library portable. The techniques in the first link will work when moving the library between Windows and OS X as long as the library is "portable", but iTunes takes quite some time checking the database when the library is opened under a different OS.
    tt2

  • ICal "all day events" separator bar

    Is it possible to adjust the "all day events" separator bar in iCal in the Daily or Weekly view.  When you have more than 6 all day events on one day a scroll bar appears, and it's not possible to view all of the all day events at once.  I know that this sounds like nit-picking, but I've developed a work-flow where I would like to look at all of the informaiton at once without extra clicks or scrolls, or to glance at the information without having to bring the application to the surface, or make it the active application.
    Does anyone know if there is a way to adjust the separator bar to allow the user to see more then 6 all day events in the weekly or daily iCal views
    Another ideal solution would be additions to the View or the Preference options that would allow the user to view all of the "all day events" and have the separator bar automatically adjust.
    thanks,

    I agree with you...  this used to be a flexible field and would handle infinate "all day" events.    To answer your question...  no, you cannot adjust this field.  I too use this for business and really need to view all the "all day" events.  I've been forced to use the daily view and put a date notation in the "location" field to know when the event ends.  It's the only way to see everything.
    I found a nice little calendar program SaiSuke but Apple doesn't play well with others.  You can enter into the iCal or iCloud calendar program and it will seemlessly appear through iCloud into the SaiSuke calendar.  But Apple will not release the information allowing SaiSuke to talk back to iCloud. 
    Basically what I'm saying is it's a one way conversation between SaiSuke & iCloud, it can bring data in but not return data back.  So if you enter a new event in SaiSuke it will not be anywhere other than the iPhone or iPad you entered it on, it cannot make it back to iCloud without plugging your phone in and doing a manual Sync.  Of course this process will produce duplicate events. 
    So unless someone out there has more knowledge ...  and you want to have your events be the same on multiple platforms (phone, pad & desktop) we are stuck with using their iCal product.  Apple calls this progress.

  • Why is ical automatically setting new events as "all day" events in Lion

    After upgrading to Lion, everytime I add a new event in the Month panel it automatically selects the "all day" checkbox.  It didn't used to do this and it's kind of annoying....anybody else?

    Gustlock,
    Default event creation in Month view results in an all day event.
    Lion iCal Help (Add events to a calendar) says: "Add a new event in Month view by double-clicking within the day you want the event to appear. Enter a name and time duration for the event in the event’s title field, and then press Return."
    So, in your case try entering "Meeting at 9am"...that will create a one hour event named Meeting.
    Lion iCal data detectors are supposed to make entry easier??

  • How do I expand the view of all day events in iCal?

    I am unable to find an answer to this question any where.  Is it possible to expand the area in iCal where all day events appear in the day and week views?

    Did you ever get an answer on this?  I can see everything in the DAY view but need to see the all day events in the week view.  I have events that start on say the 15th and run to the 21st.  I've started putting the end date in the location field but it was so much nicer when the all day even portion expanded to allow you to see all of them without having to scroll.  Having to use the DAY view makes it really hard to schedule.  Any chance this will change in the new version?

  • ICal all-day event problem

    iCal on my iPad worked fine for a while. Now, many of my all day events (but not all of them) are showing up a day early on my iPad on week view. Everything is fine on all other devices (iPhone, MacBook) and all is fine on iPad on day, month and list view. All timed events are in the right place. But all day events in week view are a disaster and turning off the iPad isn't helping. Any advice?

    Did you travel out of your home time zone and first notice the problem then? I spent an hour and a half on the phone with Apple Care while I was in the Central zone (I live in Eastern) and nothing the supervisor suggested worked (deleting the account, resetting, turning ipad off, etc). They'd bumped me up to a supervisor because the regular guy had no idea. Supervisor said no one on the internal tech board had seen that particular problem. The final assumption was it was a software glitch on my ipad--the advice was a complete restore which was going to have to wait until I returned home because he said it would take too long over the Verizon mi-fi I was using while traveling. Anyway--I got home to Eastern time, immediately pulled out the ipad to do the restore and all the all-day events were in the right place and have remained in the right place since then. My best guess is that it's a time zone issue but it doesn't make much sense. All my timed events stayed right where they were supposed to be the whole time (time zone support turned off).

  • All-day Events Disappearing

    Hi,
    I switched to Mac last year and haven't had any problems until now. I was recently using iCal when it quit unexpectedly. I got the program to open again by deleting the application preferences (although I also tried repairing permissions). However, now I can't create multi-day, all-day events that appear in Month view (non all-day events don't have a problem) - they only appear in week/day view. Also, there seems to be extra trouble with the month of March 2011, especially the 12/13th. I can't get to March 2011 by seeking through the months on top, and when I do find a way to get to March 2011, the 12 and 13 are often times on top of each other, or the 13th is un-editable.
    I'm trying to find a way to fix this short of un/re-installing! Thanks!

    I do have a backup which is the only way I was able to get the events to come back (other than the 2nd time it happened when they magically reappeared on their own after a few minutes). Once I restored from the backup, I then reset the sync data and overwrote the local contents with the contents from MobileMe to make sure everything was current. I considered downgrading but I think I'll tough it out for now and just keep making backups. I noticed that iCal is spitting out a bunch of messages to the system console, so this should help me dig deeper into the problem if it happens again.

  • All day events are shifted one day forward (Nokia 6234)

    I know that the Nokia 6234 is not officially supported for iSync, however I have found a plugin that works very well.
    I am, however, perplexed by the fact that all day events are shifted to the following calendar day on my phone. If I try to move a read only event to the correct day on my phone, I get an error from iSync/iCal saying you are not allowed to edit a read only event.
    I have checked the time zones for the phone and my system and the are both the same (GMT+12). I've turned time zone support on and off in iCal, with no effect.
    I've tried some different values for the property "AllDayEventFormat" in the Metaclasses.plist, but they didn't seem to make any difference. Maybe because I didn't un-pair and re-pair the phone in between making changes?
    Any ideas?

    Hi Julian,
    Thank you for your advice The plugin was a free download, not a purchased item. So the provider is in no way beholden to provide assistance, as it was provided on a best efforts basis. However I have approached them for help also.
    Next step: make my own plug-in!?

Maybe you are looking for