Getting ical to speak current calendar events

I am admittedly an applescript rookie. I am trying to figure out how to get the computer to speak today's ical events.
I have found this information:
http://www.macosxhints.com/article.php?story=20091115201138792
I have installed the necessary icalbuddy program:
http://hasseg.org/icalBuddy/
The problem is writing the script to work correctly. I would like to go just a little bit further. So far, I can get it to speak the days next event, but on some days there are no events so I would like it to react to that and say "Today you have no appointments"
This is the working script:
set theNextOrCurrentEvent to (do shell script "/usr/local/bin/icalbuddy -ic "mycalendarname" -eep "*" -nc -b "" -n -li 1 eventsToday")
say "Today you have" & theNextOrCurrentEvent
My experience with using conditionals is very limited. This is what I have so far:
set theNextOrCurrentEvent to (do shell script "/usr/local/bin/icalbuddy -ic "mycalendarname" -eep "*" -nc -b "" -n -li 1 eventsToday")
if result is equal to "text" then
say "Today you have" & theNextOrCurrentEvent
else
say "Today you have no appointments"
end if
If I run the very simple version:
set theNextOrCurrentEvent to (do shell script "/usr/local/bin/icalbuddy -ic "mycalendarname" -eep "*" -nc -b "" -n -li 1 eventsToday")
if there is no event it will show the results as simply: ""
if there is an event it will give me the name of the event: "event"
How can I write this script? I suspect my problem is with the "text" part. I have tried to google this extensively but haven't come up with anything useful.
Thanks in advance for any help.
Sincerely,
Michael

Thanks for your help with this script. I really appreciate it. Here is the final script that I ended up going with. The only challenge I had was dealing with multiple calendar items.
say "lets look at today's schedule"
set theNextOrCurrentEvent to (do shell script "/usr/local/bin/icalbuddy -ic "mycalendarname" -eep "*" -nc -b "" -n -li 10 eventsToday")
if the result is not "" then
repeat with anEvent in (paragraphs of theNextOrCurrentEvent)
say "Today"
delay 0.5
say anEvent
delay 1.5
end repeat
say "there is nothing else scheduled for today"
else
delay 2
say "You have nothing scheduled for today"
end if
Thanks again.
Sincerely,
Michael

Similar Messages

  • ICal not seeing Exchange Calendar events

    My iCal started behaving strangely in that it was importing exchange events into my personal calendar instead of my Exchange calendar. After trying several things I deleted "my card" in address book, and tried to recreate it in my exchange address book, thinking this would redirect all of my calendar events to exchange (since that was where my address card would be). When I realized that creating a "my address card" on the exchange side of the address book wasn't possible, I recreated the "my card" in the local address book on my mac.
    The next thing I tried was to delete my personal calendar with the hope that this would force all calendar events coming into iMail to use my exchange calendar (seems logical, right?). I figured it wasn't a big deal since I wasn't using my personal calendar anyway (I use my exchange calendar for everything). The end result is that none of mail calendar events will now import into iCal..... at all.
    Any suggestions?

    /bump
    Anyone?

  • How do I get the pc to upload calendar events to the cloudy?

    I cannot get calendar events posted on my windows 2007 outlook calendar but they are not showing up on the cloudy.  yes i refresh  the calendar and use the cloudy page  in Outlook calendar 2007.  It appears the refresh down loads but does not upload events enterened in Outlook.  An example is I loaded on the Outlook calendar holidays but those events did not get uploaded to the icloudy. Am I correct on the upload assumtion and if so is there a solution?

    You should install iTunes for Windows and sync your iPhone with it.

  • Why do I get duplication of Contacts and Calendar events.

    I just purchased the Iphone 3GS and have a problem with duplication of calendar events AND contacts.
    I "THINK" the problem is that I set it up to syn with mobile me and also perhaps with my itunes when I connect it for ringtones, video's, music, etc.
    For example under contacts, I have a section called "From my Mac" and one "my xxx@mac (mobile me)
    I think this is where it comes from.
    Any help on explaining this and what to do without screwing my system up, would be GREATLY appreciated.
    Skip

    Up to a week ago I'd been using my Outlook calendar to synch to the iPhone. Last week I set up a Google calendar and synched that with Outlook and in turn with the phone - so I got two lots of everything appearing in my phone calendar, and opted for just one to show.
    As mine both had identical information in (as they came from the same source) there was little point my having the Google calendar synched to the phone, it was more an excercise of checking what would happen.
    I have a choice of either of the calendars to show through, or both - and if I choose both naturally there are double entries.
    I assume what you have done is the same.
    So for the calendar just decide which of the two you want to be the one that shows through on the iPhone.
    I don't have duplicate contacts though.

  • Getting Undeliverable Email when Sending Calendar Event

    My CEO bought a new iPhone and I have it working with our Exchange 2003 email server and Outlook 2007. The only problem he has is when he sends a calendar event it sends an undeliverable email. The strange thing is the event shows in his Outlook calendar.
    The full undeliverable email is:
    Your message did not reach some or all of the intended recipients.
    Subject:
    Sent: 1/5/2010 9:21 PM
    The following recipient(s) cannot be reached:
    System Attendant on 1/5/2010 9:21 PM
    The e-mail address could not be found. Perhaps the recipient moved to a different e-mail organization, or there was a mistake in the address. Check the address and try again.
    <Exchange.XXXX.LOCAL #5.1.7>
    Any ideas?

    Hi,
    Based on the error message, I think it's a permission issue.
    It seems the user who is trying to send the message does not have "Send on Behalf" permissions or "Send As" permissions to the mailbox. Please confirm this, grant the user the proper permission if he doesn't have it.
    Set the user as a delegate automatically receives "Send on Behalf" permissions. For example, to designate a user as the delegate in Outlook 2010, follow these steps:
    Click the File tab, click Account Settings, and then click
    Delegate Access.
    In the Delegates dialog box, click Add.
    Type the name of the person whom you want to designate as your delegate, or search for and then click the name in the search results list.
    Note The delegate must be a person in the Microsoft Exchange global address list (GAL).
    Click Add, and then click OK.
    In the Delegate Permissions dialog box, accept the default permissions settings or select custom access levels for Exchange folders.
    To send a message to notify the delegate of the changed permissions, click to select the
    Automatically send a message to delegate summarizing these permissions check box.
    If you want to grant additional permissions for the delegate to view private items, click to select the
    Delegate can see my private items check box.
    Click OK two times.
    If the user needs the "send as" permission, you may need to do it on Exchange. If you have any questions about granting the user "send as" permission, you can post a question in Exchange forum:
    https://social.technet.microsoft.com/Forums/office/en-US/home?category=exchangeserver
    Regards,
    Melon Chen
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please click
    here

  • Ical won't highlight calendar events in week view

    When I click on a certain calendar, all the events from that calendar don't become highlighted like they did in Tiger iCal. This is annoying. Anyone else have the same issue?

    I'm having the same problem too. I suspect it's a deliberate UI change on Apple's part, so I think everyone needs to lobby them to persuade them to change it back, since it's obviously not as good!

  • How to I get iCal/iCloud to retain old events?

    I've just switched over to icloud. I thought I had it all setup, but when I went to look at an event that occurred last year (to check the date), it was gone! In fact, everthing older than a couple of months is missing.
    My life is in that calendar. How can I get my life back?

    Welcome to the Apple community.
    Did you restore from the old back up.
    Were these photos part of your camera roll or photo stream.

  • How do I get iCal to stop defaulting new events to all day?

    Just updated to Lion.   Overall everything is working well.  However, I can't stand some of the things the new iCal is doing.
    By default it is defaulting new events to all-day (Rather than setting a time like it did before).  Is there anyway to change this back?

    This was discussed endlessly right after Lion came out.
    Short answer: I don't think you can change this behavior in month view.
    However: When you type an event, e.g., "Meet with TIm Cook for lunch, 1 pm", iCal is smart enough to set the time (at 1 pm in this example).
    chalrie

  • How do I get iCal to print the calender just as it appears on the screen, not as lines down the side to indicate length of event?  I like the whole bubble of time approach as it is on the screen.

    How do I get iCal to print my calendar just as it appears on the screen?  I like the whole block-out method rather than just a line down the side indicating the time devoted to an event.  Is there any way to change the style of how it' sprinted?

    View > Sidebar > Bookmarks (Ctrl+B)
    Press F10 or tap the Alt key to bring up the "Menu Bar" temporarily.

  • Create a Reminder from Calendar Event

    I am trying to create an applescript application that will automatically create a reminder when triggered by an alert. I want the name of the reminder name to be the same as the name of the calendar event.
    This simple applescript will create a new reminder when "opened" by a calendar alert:
    tell application "Reminders"
              make new reminder of list "To Do" with properties {name:"This is the new reminder"}
    end tell
    Is there anyway I can get this script to 'get' the name of the calendar event that "opened" it and use that for the reminder name?

    You cannot drop something onto an app window that was still in Exposé mode (only window on a dark background). After hovering over the app icon, and when the app window appears in Exposé, hover over that until the app comes into the foreground. Then, you should get a green + badge on the drag icon.
    If you start dragging and cmd-tab to Reminders, the window should be an active drop zone immediately.

  • Icalendar | Imported calendar events not synching

    I just imported several years worth of events into icalendar on my iMac (mountain lion). I imported these from an outlook file. 
    Ical has categorized these calendar events as "On my Mac" and I have named them "palm". (All of these events were shaded in grey. I changed them to yellow.)
    Unfortunately, I don't see these calendar events on my ipad or iphone.
    I would like these events to synch via icloud to my ipad and iphone. Is there a way to do this other than clicking on each calendar entry and manually changing the 'color' ?
    Other than these 'imported calendar events", all other calendar entries (icloud : "work", "calendar" & "home") 'synch' via icloud between my imac, ipad and iphone correctly.
    See attached screen shot.
    Thanks in advance!

    Linc Davis - That method didn't work. It would drag down but wouldn't stick. Just returned to orginal position.
    Fortunately I found this and it worked.
    iCloud: Manually importing data from Calendar or iCal to iCloud Calendar
    http://support.apple.com/kb/HT4967

  • Double Calendar events and notifications

    Hello everyone,
    I am getting double Calendar events and notifications, that is, instead of getting and seeing one notification/calendar event, I get two of the same one.
    Yesterday I was setting up iCloud so it may have something to do with that but I don't know what.
    Also, in my Calendar Settings, I have the same calendars listed ( Work, Home, Personal, etc) under "From my Mac" and the another under iCloud.
    This might have something to do with it too ...
    But I still don't know what I need to do in order to stop getting double notifications and alerts.
    Any ideas, suggestions??
    thanks!!

    okey-dokey, and now imagine I have 250 events in calendar
    sitting one hour somewhere and changing some of them in such a manner - will make anyone mad... unless he has non-nokia device... mua-ha-ha
    Of course it's related to the bug you described (I've encountered it too).
    But regarding my initial problem as in header of topic - I'm pretty sure it does exist.
    I deleted ALL entries in my Nokia calendar and have been ultimately suprized to hear reminder popping up. I even searched through calendar and alarms to see if anything left by chance. No - both were empty. Presume this bug is somehow related to the second one you described.Message Edited by sidream on 16-Oct-200704:14 PM

  • To maps from calendar event

    How can I easily get to maps from my calendar event? I have tried both typing the address to the address field and notes field. However in both cases by cliking the address it won't take me to the maps like it does in Contacts. Can iPhone 4 really lack this function?

    Yes, I think you've misunderstood. He doesn't know where to go until he looks his appointment in calendar. Now he wants to find out where it is and how to get there.
    So, from this point, in order to get the maps app to search for that location, you have to open the appointment, edit the appointment (because this is the only way to get copy and paste to work at this point) copy the location, close the calendar app, open the maps app, paste the location.
    It would be great if the the iPhone software recognized locations (especially since when they are within the location field) so that you could just tap on it and it would open within Maps.

  • I am trying to download a calendar into ical and keep getting this message-Some of the events in this calendar have alerts that open files or applications.  What am I doing wrong???

    I am trying to download a calendar into ical and keep getting this message-Some of the events in this calendar have alerts that open files or applications. Remove alerts or cancel 
    What am I doing wrong or missing??

    I have this same problem in October of 2013. I am unable to import .ics files into Lion that I exported from my Snow Leopard MacBookPro without losing all of my future events (which all have alerts attached). All of the events from BEFORE today's date are successfully importing, presumably because they are no longer expected to trigger alerts via Apple Mail. After my first unsuccessful attempt, I learned that iCal was communicating with iCloud by default. I have since turned off iCloud, but I have not found a solution to the problem. Harvey

  • Why do I get "iCal can't read this calendar file. No events have been added to your iCal calendar." when I am trying to sync an Apple Workshop appointment?

    I made a reservation for an Apple store workshop, but when I try to open the download in iCal (Lion) , I keep getting an "iCal cannot read this calendar file." message.  Very frustrating.  Any insights would be appreciated.
    Thanks,
    Bmoregirl

    Greetings,
    What version of the Mac OS and what version of iCal are you running?
    Are you using MobileMe calendars (or any other server based calendars like Google) in your iCal?
    While you answer those questions you can try the following troubleshooting:
    1. First make an iCal backup:  Click on each calendar on the left hand side of iCal 1 at a time highlighting it's name and then going to File Export > Export and saving the resulting calendar file to a logical location for safekeeping.
    2. Remove the following to the trash and restart your computer:
    Home > Library > Caches > com.apple.ical
    Home > Library > Calendars > Calendar Cache, Cache, Cache 1, 2, 3, etc. (Do not remove Sync Cache or Theme Cache if present)
    Home > Library > Preferences > com.apple.ical (There may be more than one of these. Remove them all.)
    ---NOTE: Removing these files may remove any shared (CalDAV) calendars you may have access to. You will have to re-add those calendars to iCal > Preferences > Accounts.
    Once the computer is back up and running open iCal and test.
    Hope that helps.

Maybe you are looking for