Applescript no longer steps through iCal events in sequence

Hi all,
I have been using an Applescript that someone on this forum helped me write a few years ago to put unique combos of events into iCal and it has worked perfectly for me, although this year it has begun to jump around within iCal when it is adding events. In other words it used to step through the calendar and add events day by day, progressing chronologically. Now it still accomplishes the task but starts (currently) with May 1 of 2011 and moves to May 16th ... The fact that it still works is cool, but it has slowed the applescript down quite a lot.
Here is a section of the script...thanks, dan
<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px; height: 340px;
color: #000000;
background-color: #FFDDFF;
overflow: auto;"
title="this text can be pasted into a HTML editor">
repeat with theEvent in (events of calendar "School Calendar 10-11")
if isitacycleday contains (summary of theEvent) then
--Gets the current day and the cycle day number
set cycleday to summary of theEvent
set cycleDate to (start date of theEvent) + 1 * hours
set cycleNumber to last character of cycleday as integer
--There are always 7 periods in every day
repeat with periodNumber from 1 to 6
--Gets the subject from periodCycle
set theSummary2 to item periodNumber of item cycleNumber of periodcycle2
set theSummary to item periodNumber of item cycleNumber of periodCycle
--Checks to see if there's a subject for this period, if not skips to next one
if theSummary2 is not "" then
set theStart to date (startTime of item periodNumber of periodTimes) of cycleDate
set theEnd to date (endTime of item periodNumber of periodTimes) of cycleDate
--Makes the event in the calender whose name is defined at the top of the script
make new event at end of calendar TargetCalendar with properties {summary:theSummary, start date:theStart, end date:theEnd}
end if
end repeat
end if
end repeat </pre>

Hi Bernard,
right, I believe you were the one that came up with this script! It still does the trick, although it does begin adding new events at different times depending on when the cache was last deleted (i think). I've used the Onyx program to do this and indeed it influences the start date for the creation of new events via your script, so I don't think it has anything to do with the master calendar. Since I repeatedly run this script to make new events and then export the calendar, delete it, make a new untitled calendar and then run the script again... I've found that iCal and the applescript sloooow down over time and it is best to quit both, maybe even restart and then start the process again. Guess I might never figure this one out.
Thanks for the help,
dan

Similar Messages

  • Can I instruct the debugger to step through triggered events as well?

    I have the following statements in my code:
    Public Class Class1
    Public Shared Sub TestClass()
    Dim ExlApp As Excel.Application = CType(AddinModule.CurrentInstance, TimeTracker.AddinModule).ExcelApp
    ExlApp.Range("A1").Value = "Test"
    ExlApp.Range("A2").Value = "When I press F11 the debugger jumps to this row from test"
    End Sub
    End Class
    When I step through the debugger, it jumps directly from the first statement above to the second. But inbetween those rows some events are triggered. Is there any way to tell the debugger to not jump over these events but instead step into these events?

    Hi JP3O,
    Since it is related to the specific VB app, to really repro this issue, could you share me the sample?
    >>But inbetween those rows some events are triggered.
    Maybe you could add breakpoints in your events, and then debug your whole app with "Start debugging (F5)", and make sure that the code is really called (the breakpoints were hit)or it has been called before the code shared in your thread.
    Or it is related to the JIT:
    https://msdn.microsoft.com/en-US/library/7ad07721(v=vs.100).aspx 
    If the breakpoints in evens are not hit, please check whether you could get any message if you put the mouse on the breakpoints. Maybe it is related to the symbols loaded or others.
    If you get any latest information, please feel free to let me know.
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • ICal Event Handling And Exchange

    Okay. I'm having problems figuring out how iCal in Snow Leopard is handling meeting invitations. When I get a new meeting invite in Mail.app and I double-click on it, it creates an event in iCal. If I open that event, the popup gives me the option to click on "Maybe", "Accept", or "Decline". If I click on "Accept" the event window goes away and iCal comes back up.... but it doesn't appear to save my response. If I click on the event, it still shows me the same button options. This would all be fine... except for the following issue....
    As long as an iCal event is in the "invitation" state, I can't change the event from it's default local calendar to the Exchange calendar. I can move it around within local calendars, but the Exchange options are not available from the pulldown menu. If I create a new event manually, then the Exchange options are available from the pulldown and I can move events to it just fine.
    I can't figure out how to get invitations (1) accepted and saved as accepted and (2) moved to the Exchange calendar.
    Anyone have any ideas?

    I've found a work-around that SORT of lets me function for now:
    1) Right click on the event.
    2) Select "Create Duplicate"
    3) Right-click on the new duplicate.
    4) You can now select your Exchange calendar to move it over.
    5) When you try to select the OLD event, iCal will REQUIRE that you send a notification out to the meeting invitees. This is ENTIRELY too inconvenient for me (as I work for Government and Army Colonels do NOT want my meeting spam) so I click on EDIT and then remove all the invitees and then save. This gets around the requirement to send the notice.
    6) THEN I can select the OLD event on my local calendar and delete it.
    This is FAR from a good solution as it requires me to lose all the meeting attendee information AND there's something broken in the requirement to send the meeting notice out again for the duplicate.. but at least I can get events onto my Exchange calendar for now.

  • Using AppleScript to step through a txt file.

    I am new to AppleScript but not programming.
    I have a program in AppleScript that currently takes my integers
    Ip, user, passwrd  and uses the in terminal to gain access to our clients machines and do certain tasks.
    I would like to have a txt file filled with the ip addresess so that I can simply step through the file.
    I can read in from the txt file but it simply reads the entire thing and crashes out my program.
    Can someone please help?
    Thank You.

    I can but I cannot.
    Text file would be as follows
    10.10.10.20
    10.10.10.21
    10.10.10.25
    10.20.45.200
    84.30.26.79
    So on and so forth for all the IPs of our clients machines.
    The script has the variables as follows.
    set acct to "admin"
    set pass to "password"
    set addr to "10.10.10.10"
    set rightServer to "Connected to " & addr & "? If not fix it!"
    #Login Process
    activate application "Terminal"
    delay 1
    tell application "System Events" to keystroke "ssh " & acct & "@" & addr
    tell application "System Events" to keystroke return
    delay 2
    activate application "Terminal"
    Then the script goes on from there to do some other things.
    I need help with the login process.
    I would like to set it to a txt file and watch as it steps through the file so its more automated.

  • I can no longer EDIT nor VIEW events created in iCal...

    I have a problem with my iCal in that I can longer edit nor view events.
    I can create events, but only the first line of the details for a new event. I am not able to edit or add more info in any way after that (date, time, details, etc.)
    I can delete the event though.
    When I say I cannot edit nor view events, this problem occurs when double-clicking, when right/CMD-clicking, choosing the relevant command from the menu, or when typing the keyboard shortcut of either CMD-i or CMD-e.
    Nothing works. Nothing happens. It's as if I have chosen to do nothing at all.
    I have an iPhone which I use to sync events between my Mac and my iPhone, but without being able to properly create an event on my Mac with a chosen time and alarm, etc. iCal on my Mac is almost useless. All my events now have to be created on my iPhone - even when I am sitting right in front of my Mac.
    The only use my Mac's iCal is to me now is for pop-up reminders after an event from my iPhone has been synced to my Mac.
    The problem I am having with iCal is happening with all the calendars I have set up.
    I have no online subscriptions, everything's local.
    I have my iPhone set to auto-sync with my Mac for all data.
    I am running the latest versions of iCal, the Mac OS (Leopard), the latest iPhone OS, etc.
    I tried deleting all my iCal preferences from the ~username/Library/Preferences, but that didn't work.
    I tried deleting all my calendars from within iCal in case there was a corrupt calendar, but that didn't work.
    I trashed everything I could find that had anything to do with iCal (knowing I could restore from a recent Time-Machine backup), but still nothing worked.
    Even when I had an empty iCal to work with, creating a test new-event revealed the same problems of not being able to edit the event after the first line.
    I have since restored all my data from the backup I did the other day, so I am back to square one - not that anything I tried before this actually moved me off square one in any way...
    Can anyone help me here? It's getting really frustrating having to type all my events out on the iPhone screen, especially when I'm sitting at my computer.

    Similar problem here. My Ical refuses to edit or delete events. Viewing is possible, though sometimes the whole screen turns grey. Adding new events from mail is still possible. The task-pane completely disappeared. My local apple technic-centre messed about with disk utility for a bit and than told me to reinstall leopard. I could of course do that, but it seems to me that reinstalling Leopard just to fix iCal events is a bit invasive.
    I tried also tried removing everything, installing a new copy of iCal from the leopard-cd, software updates, all to no avail.
    At the moment I'm open to all suggestions that do not include a complete leopard reinstall.

  • Ical events to Mac Addressbook....plugin? applescript?

    If you have an Ical event with name and location (address) is there a way to import that information into addressbook for mac and create new entries?

    Hi,
    If you were guaranteed that the format was going to be the same every time, it would be possible do this by selecting the text and using an Applescript.
    Best wishes
    John M

  • Events created on my iPhone 5 calendar are no longer syncing with iCal.

    Events created on my iPhone 5 calendar are no longer syncing with iCal on my Macbook Pro (Lion OSX). It works fine the other way around.
    I can't understand why, and cannot find a solution. Please help!

    You can no longer sync via iTunes. That method of sync was removed (and the 1000+ post thread is arguments over things tangientally related to that).
    You need to sync via other means than iTunes, then.
    One option is to use iCloud. If you sign into iCloud on all your devices, and then make sure your calendars are in the "iCloud" section on your devices, they should sync.
    If you don't want to use iCloud, you could use Google calendars, they operate much the same way (but may be less reliable).
    Or if you use Exchange for work, you could sync that way.
    Or if none of those are acceptable, you could install OS X Server and set up the calendar server on your local network and use it to sync. This is fairly straightforward "for setting up a UNIX calendar server" but it's not trivial and beyond the scope of a forum post to explain it all

  • Unable to sync certain iCal events through 10.7 to iCloud

    I am unable to sync "certain" iCal events from my MacBook Air (10.7.5) and iCloud ... which, unfortunately, doesn't allow my iCal event to get to either my other MacBook Pro, iPhones or those to whom I'm attempting to inform of events. Specifically these events have an attachment (Add file) and a "Show in Mail" URL. Now ... iCal automatically loads these two additional attachments when capturing an event off an email.
    Bottom Line: Do I need to ensure iCal and Mac Mail NEVER do this, or is there a way to allow these events to be passed through iCloud? Inquiring minds ...

    Hello Dominick Issi,
    It is definitely hard to stay on schedule if the calendars on your devices stop syncing.  I recommend reviewing the articles below to troubleshoot iCloud calendar syncing issues:
    iCloud: Using and troubleshooting Calendar attachments
    http://support.apple.com/kb/HT5373
    iCloud: Troubleshooting iCloud Calendar
    http://support.apple.com/kb/TS3999
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • ICal event alarms aren't loud enough (and not long enough)...

    I'm going to be getting my first smartphone very soon and am trying to decide which to get. I have an iMac, so I heavily favor the iPhone. But, I've run into a potential problem with Events in iCal:
    I want to get an iPhone, use iCal for my schedule, and use MobileMe to keep everything synced. Until now, I've only used the calendar features in regular phones. I've been testing iCal on my Mac, and it clearly will be easier to program events into it.
    My problem is iCal's audible alarm. I've been testing it by having it sound on my iMac (since I don't yet have an iPhone), and it seems you can only have a brief audible alarm sound (for instance, the "Glass" or "Basso" sound option with the "Message with Sound" option). I'm used to the calendars on regular cell phones, which have a loud alarm that repeats (like a cell phone ringer). Is there something I can do in iCal to make its alarm louder and repetitive on an iPhone?
    I have a friend who has a droid phone and used the Google calendar. He says there is a setting on his phone (separate from the settings in Google's calendar) that lets him choose any ringer or .mp3 as the audible alarm for alerts from the Google calendar.
    If I can't get a loud, repetitive alarm to sound on my iPhone with my iCal events, then it's really not going to work for me. The alarm will be going off on my iPhone and I will never hear it.
    I know this question may be basic, but I really, really need an answer before I proceed (and I can't find the answer online). Thank you!

    That is very surprising. Short of someone being able to recommend an app or other work around for this, the lack of such an audible alarm will rule the iPhone out for me. And I've waited a very long time for it to come to my carrier, so that is very disappointing.
    It's really shocking to me that the designers wouldn't have started out by saying we need to have this smartphone incorporate every standard feature of previous regular phones. I had really not even thought that this could be a problem. I just stumbled on it and am astonished at the lack of a user ability to customize the alarm feature to a suitable sound.

  • How to edit events on a iCloud-shared calendar through iCal? It works fine on my iPhone.

    My wife and I share calendars through icloud. Through ical, I can not edit her events, but she can edit mine. I can, however, edit her calendar events through my iphone. We both seem to have our calendar settings to allow view and edit. How can I edit her

    Hey Butterworth,
    You may need to use the information in this article to help you troubleshoot the issue with your outgoing server:
    OS X Mail: Troubleshooting sending and receiving email messages
    http://support.apple.com/kb/ts3276
    Thanks for coming to the Apple Support Communities!
    Cheers,
    Braden

  • AppleScript opens iCal event, but prompt to add event doesn't pop up

    Ok, so I have a script that I cobbled together from other sources to do the following:
    It will read an emailed iCal event and look for the "ORGANIZER" line and delete it, after which it opens iCal and adds the event to whichever calender i choose. I made it a droplet app and also an application bundle so that i could set it as my default app for .ics files. I need this because of some strange happenings when dealing with CalDEV, if the ORGANIZER line is present, people can't add the events in iCal.
    Here's the problem, the script functions exactly the way i want up until opening iCal. iCal opens, but the prompt asking which calendar you'd like to add the event to never appears, or rather the prompt only appears after i've clicked away from iCal. So if iCal opens, and I stay on it, every click following is just answered by a beep (which is the, "there's an alert window open, and you need to respond to it" beep, but it isn't until i click away from iCal that the prompt appears.
    here's the script:
    property pTypeList : {".ics"}
    on open processItem
    set SomeFile to (processItem)
    set SomeText to (read SomeFile)
    set {SearchText, ReplaceText} to {"ORGANIZER", ""}
    set {TempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, SearchText}
    set {TextItems, AppleScript's text item delimiters} to {text items of SomeText, ReplaceText}
    set {SomeText, AppleScript's text item delimiters} to {TextItems as text, TempTID}
    set OpenFile to open for access SomeFile with write permission
    try
    set eof of OpenFile to 0
    write (SomeText) to OpenFile as text
    close access OpenFile
    end try
    tell application "iCal" to open SomeFile
    end open
    If i change the last tell line to have "Finder" open SomeFile, the droplet works fine, but I can't set the script as a default app since it will get stuck in an endless loop. I myself don't mind have to drag the events to the script, but i wrote this for people in my office, and the less they have to do the better.
    I'm not sure of the problem has anything to do with the script but any suggestions would be greatly appreciated and thanks ahead of time.

    Hi,
    I think you'll need to tell iCal to 'activate' or the dialog window gets stuck behind iCal's main window.
    Something like:
    tell application "iCal"
    activate
    open SomeFile
    end tell
    Best wishes
    John M

  • Applescript ical event at specific time of day

    I'm trying to find a way to have a script create an iCal event for a day away. I use (current date + 1 * days) but this creates the event one day away at the time the script runs. is there a way to create the event one day away at 8:00am each time?

    The current date includes the time, so you can just set the time separately, for example
    set theDate to ((current date) + 1 * days)
    set time of theDate to 8 * hours
    theDate -- > next day at 8:00AM

  • Scripting iCal Events

    As part of a school project, my students gather weather data when a specific NASA satellite passes over our school. We have to keep an eye on the schedule we receive and collect our data. Every once in a while we forget and miss an overpass. I decided to enter the satellite overpasses as iCal events and have an alarm sound to remind us. This tedious task of entering the events sounds like a great job for AppleScript. This AppleScript project is a little over my head because I don't understand insides of iCal and AppleScripting.
    The satellite schedule comes as text in an email and looks like this:
    Date & Time | Satellite Position
    Mo Day Year Local UT | view sat azm relative solar sat. position sat
    Time | zenith fr. N azimuth zenith lat. long dir
    Local Time = UT + (-6.0)
    9 16 2008 12:19 18 19 | 6.46 104.44 51.37 40.32 39.94 249.13 des
    9 17 2008 13:02 19 02 | 54.05 289.85 117.31 38.45 42.22 239.04 des
    9 18 2008 12:07 18 07 | 27.40 102.13 49.98 42.00 39.43 252.03 des
    9 19 2008 12:50 18 50 | 42.63 287.75 119.55 39.58 41.48 241.85 des
    9 20 2008 11:55 17 55 | 43.58 99.08 49.57 43.80 39.09 254.98 des
    The only important info for our observations is the Mo, Day, Year and UT time — the other satellite info is not relevant to our observations.
    How would I write a AppleScript that would strip away the unimportant info and create a different event each time for the satellite overpass? The iCal event would need to start 15 minutes before and end 15 minutes after the UT time given.
    TIA
    Message was edited by: Stephen Bunker

    Here is some sample code.
    -- Code starts here --
    property tFile : "HD01:Users:dev_sleidy:Desktop:SatelitePasses.txt" -- Location of Satellite information file.
    property tCalendar : "Satellite" -- Name of 'iCal' 'Calendar'.
    set tText to paragraphs 5 through -1 of (read file tFile) -- Obtain specific lines (paragraphs) of Satellite information file data.
    set {oASTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, " "} -- Configure delimiter.
    tell application "iCal" -- Focus on 'iCal' commands.
    tell calendar tCalendar -- Focus within the 'tCalendar' calendar.
    repeat with i in tText -- Cycle through the obtain paragraphs of data.
    tell i to set {tMonth, tDay, tYear, tTime, uHour, uMinute} to {first text item as number, second text item as number, third text item as number, fourth text item, fifth text item, sixth text item} -- Obtain specific information from within a paragraaph.
    -- Create a new 'date' based on obtained Satellite data.
    set tDate to (((tYear as string) & "-" & my handle_Number(tMonth)) & "-" & my handle_Number(tDay)) & "T" & tTime as «class isot» as date
    -- Create a new 'iCal' event, including 'display alarm' setting.
    set tEvent to make new event at end with properties {start date:tDate, end date:tDate, description:(uHour & "." & uMinute & " UTC")}
    tell tEvent to make new display alarm at end with properties {trigger interval:-15}
    end repeat
    end tell
    end tell
    set AppleScript's text item delimiters to oASTID -- Reset delimiter.
    on handle_Number(lNumber) -- Manage single digit date values.
    if (lNumber < 10) then set lNumber to "0" & lNumber
    return (lNumber as string)
    end handle_Number
    -- Code ends here --
    You may have to edit the code, as per the delimiters you use / set within 'System Preferences' 'International's 'Formats' 'Dates' and 'Times' configuration panels.

  • Lion 10.7.2 On both mac book pro and iMac, both with Lion 10.7.2, obtain repeated iCal event notifications from calendar or address book.  Cannot turn these off.  They repeat several times per session and every time computer is used.  How to diagnose this

    Lion 10.7.2 On both mac book pro and iMac, both with Lion 10.7.2, obtain repeated iCal event notifications from calendar or address book.  Cannot turn these off.  They repeat several times per session and every time computer is used.  How to diagnose this?

    First, uninstall "SuperTV" (whatever that is) according to the developer's instructions. It isn't working and it's filling the log with noise.
    If you have more than one user account, these instructions must be carried out as an administrator.
    Launch the Console application.
    Step 1
    Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left.
    Enter "BOOT_TIME" (without the quotes) in the search box. Note the timestamps of those log messages, which refer to the times when the system was booted. Now clear the search box and scroll back in the log to the last boot time when you had the problem. Post the messages logged before the boot, while the system was unresponsive or was failing to shut down. Please include the BOOT_TIME message at the end of the log extract.
    Post the log text, please, not a screenshot. If there are runs of repeated messages, post only one example of each. Don’t post many repetitions of the same message. When posting a log extract, be selective. In most cases, a few dozen lines are more than enough.
    PLEASE DO NOT INDISCRIMINATELY DUMP THOUSANDS OF LINES FROM THE LOG INTO A MESSAGE. If you do that, I will not respond.
    Important: Some private information, such as your name, may appear in the log. Edit it out by search-and-replace in a text editor before posting.
    Step 2
    Still in Console, look under System Diagnostic Reports for crash or panic logs, and post the most recent one, if any. In the interest of privacy, I suggest you edit out the “Anonymous UUID,” a long string of letters, numbers, and dashes in the header of the report, if present (it may not be.) Please don’t post shutdownStall, spin, or hang logs — they're very long and not helpful.

  • Convert email to ical events

    I am looking for a way to automatically convert emails i recieve into calendar events in different calendars. I have looked into the mail.app "add invitations automatically" but i dont want all my email accounts to sync with the calendars.
    I have tried mail2ical (every event gets put into one calendar, and the event time is the time of the email recieved), eventmaker (it thinks i am making events for the future). I have taken a look into automator, but im not sure if it has the actions im looking for.  
    I manage 5 different people and their work schedules. At the end of a day, after multiple projects have been worked on, i get 5 different emails each from 5 different people. Each email outlines different projects  they worked on ( project name is in the subject line), along with the time they worked and what they did.
    My current workflow is i go through each email one by one. I copy the contents of the email, then click on the time they worked to open a ical event. I then paste the contents into the notes and create a event. Each person has their own calendar which show the projects they have worked on for the day.
    I will be gettting another 5 more people to manage and with this workflow i will be manually sorting 50 emails a day! In the long run this isnt a effienct workflow, im looking for a way to automate this entirely.

    Hi,
    I wouldn't expect you are going to find an application to do that, as the format the emails you mention could vary widely.  Posibly some sort of bespoke script could do it.
    Best wishes
    John M

Maybe you are looking for

  • I can't read my eBooks I purchase from iTunes on my desktop or laptop.  Do I need to go Amazon?  Kindle?

    Is there a future upgrade or availability to read eBooks purchased from iTunes on my desktop or laptop Mac? If not, I am just going to get the free Kindle application and buy all of my ebooks from Amazon as I can read them on any Mac. I purchased a b

  • Imported resume format but how do I get keyboard access

    Imported resume template on ipad but don't know how to get keyboard to come up Help pls

  • Boot up from other node's boot disk

    Hi,at the moment I got problem to boot up one of two nodes-cluster, because its boot disk seems to be damaged. Is it possible to boot up from other node's boot disk? If yes,how to do it? If not,are there any ideas,beside replacing the damaged boot di

  • RandomAccessFile

    This class does not have a writeObject or readObject method like the ObjectOutputStream and the ObjectInputStream How am I supposed to write and read objects using random access files? Is there anyway besides just manually writing every primitive dat

  • Home directory does not mount after client has been sleeping.

    I found several articles that touches our problem, but none with any solutions so here I try from the beginning: We have an XServe Xeon running 10.6.4 and two labs with intel iMacs running the same system. All clients are bound to the server using OD