Script for missed iCal alarms

I’m sure someone has noted this problem before and has created a script already:

Here’s the problem: you create an event or to-do item (or something else with an alarm) in iCal (or some other similar application). The alarm requires you to specify a date/time for the alarm either in an actual date/time, or in some relative description such as N days before the event, or N hours before the event, etc. What happens if your machine is not running at the time the alarm is supposed to be delivered, or you are not logged in? You don’t get the alarm!!! So, if you create an important event for, say, Friday, with an alarm on Wednesday, but don’t log on Wednesday and don’t log in until Thursday, you don’t get the alarm about the important event on Friday!!

This is a particular problem if you use a laptop and the machine might be turned off or in sleep mode at the time the alarm is supposed to be delivered because you’re in your car, or in a meeting or something.

Other event scheduling software I’ve used has ways around the problem. Most of them look when the application starts running again to see what alarms are “pending” - that is alarms that were never sent for one reason or another. iCal doesn’t appear to have this feature.

In my opinion, this is a major failing of the application!

What I’m looking for is a script, so that when I boot the machine on Thursday, and the iCal application starts, I’ll get the alarm I should have gotten on Wednesday but didn’t.

I’m sure someone has written a script to get around this problem and would be very surprised to find out this hasn’t been addressed before. If I knew more about Applescript I could probably write one, and could probably figure it out after a great deal of trial and error. But, I’m hoping for a previously written solution.

I think the script would need to:

  • either run periodically, or run every time the application is started or the machine is “wakened” from sleep mode
  • read the alarms of events and todo lists for events and todo items that have not passed/expired
  • check to see if the alarms are “overdue” - that is, is there an alarm scheduled for this event or todo item that was scheduled to happen before now for an event that is at some future time but the alarm was never sent/actvated.
  • send/activate the alarm

Thoughts or (preferably) pointers to such a script?

Hi,

Are you sure that your alarm does not get activated if it was missed on its scheduled time?

I created a script that gets activated by iCal as an alarm event at a certain time. As far as I have observed, if the alarm event was missed because I had my laptop turned off, as soon as I fire up my laptop, the alarm event gets activated.

Please check it because this is always the case with my alarm event.

Good luck!

archseed :slight_smile:

Hi,

I just tested it by creating an alarm event that opens a file “Safari” at a certain time then turned off my machine and turned it back on after the alarm event has expired.

No problem - iCal activated the alarm after it was missed. So, that answers your problem, does it?

archseed :slight_smile:

Not only does it give you your missed alarms but you can also add a second or more alarms to the same event.

Check iCal/Preferance/advanced/ uncheck “Turn off alarms when iCal is not open”

I am positive that alarms do not get activated if they are missed on their scheduled time. I’ve missed MANY alarms.

It’s possible that if you set the alarm to run a script, that something gets set so that it works as you’ve observed. I don’t know because I do not have any scripts as my alarm event. At present, I simply ask for a message to be displayed.

I could try adding additional alarms - say for random times/days prior to the event in the hopes that I’m actually on the computer at one of those times. But, that seems to be a bit excessive and time consuming, and still has potential points of failure if the machine happens to be in sleep mode or something during each of those times.

I’ve also looked at the preferences and the item “Turn off alarms when iCal is not open” is NOT checked. So, that’s not the problem.

Hi,

Correction to my post. It’s not a script that I had activated but an alarm event that I created in iCal. Basically, the alarm event was supposed to launch an application, in this case “Safari”, and that’s what the alarm did even after the scheduled time was missed.

Perhaps you can try to set up a similar thing in your iCal and test it again. I am pretty sure it’ll activate even if the alarm was missed.

archseed :slight_smile:

Last night, as a “proof of concept” test, I created a dummy event for 9pm tonight. I then scheduled an alarm to occur to display a message 13 hours before the event. Thus, a message would be displayed at 8am. The machine was turned off until 10am. The alarm message WAS NOT displayed when the machine (and iCal) started up.

As I have repeatedly said, the software is broken in this regard.

I am still looking for a script that will provide a solution for the problem.

Hi,

You are quite right. Your iCal must be broken and needs to be reinstalled.

I just did what you did and my iCal worked to perfection. Other people in this forum should be able to vouch for that.

Try it again after you refresh your copy of iCal. BTW, I am now on Leopard’s iCal but I am sure the same thing worked with Tiger before.

Good luck.

archseed :o

I seem to recall this being a problem with a version of iCal a while back. I think the important question here is, what system version are you using and what version of iCal? I am not experiencing this problem on Leopard, and although I remember it being present in some version of OS 10.x, to my knowledge, it was fixed. You might also want to do a search in Apple’s discussion forum as I am sure there are old posts there in regard to your problem.

Vince

Well, as it turns out, I can’t uninstall iCal and reinstall it. The disks that came with my system don’t have iCal on it, and the only versions I found online (at sites I trust like Apple and VersionTracker) are iCal 3.0 which I’ve been told won’t run under Mac OS X.4. Sigh.

Mac OS 10.4.11 and iCal 2.0.5. As noted earlier, the only version of iCal that seem to be available is 3.0 which I’m told doesn’t run under Mac OS 10.4.

I’m getting a bit fed up with Apple and Apple software - they’ve gotten as bad as Microsloth. I’ve also noted problems with other Apple software like Mail which doesn’t properly handle junk mail or the “rules” for handling mail… at this point, I’m beginning to regret my purchase of a Mac.

Hi,

Don’t give up that easily on your Mac. I am sure you must have experienced far more worse problem in another platform where you came from (tongue-in-my-cheek :lol:).

You may not see iCal in your OS X disk so what you can do is “Restore” from your system disk, customize your restore so that you can pick only the application that you want to reinstall and then go from there. You need not do a full restore of your system and relevant applications.

If the above doesn’t work, you can try a small application called Pacifist. You can download the demo version from Version Tracker, After installing Pacifist, load your OS X disc. Pacifist will allow you to extract any application you need from your OS X system disks (Note: I got this tip from forums.macrumors.com. Thanks to alexstein and FFTT of that forum for the info on Pacifist)

Good luck.

archseed :o

Pacifist is the first thing I thought of when I read the original post. Then I thought about how some of the system updates have included changes to iCal. So if one extracts the original iCal from the installation media and used the extracted copy to replace the broken copy, it may be a good idea to reapply at least the latest combo updater (and maybe also any security updates made after the last system update, since the system update might accidentally “roll back” a problem fixed in a later security patch).

I do not know of any simple way to do this. I think it will be a matter of manually identifying, downloading and installing the appropriate updates. There might be a way to trick Software Update into doing the downloading and installation, but I do not know what that would take (would deleting the Receipts be enough? seems unlikely). Though one could use the BOM files in the Receipts to help identify which updates have touched iCal though (maybe Pacifist could help with this too, since the Receipts are pseudo-packages and Pacifist looks like it can read bare BOM files also).

Actually, I’ve used a number of different platforms over the years. I’m actually a computer programmer with over 20 years of experience. :slight_smile:

Anyway, I did a little hacking this afternoon. There are a number of odd things going on with the Mac. I don’t know if this is normal or not but looking at things in the Unix shell reveals a wide range of oddities that make no sense unless Apple is attempting to deliberately obfuscate things.

For example, when you modify a file, the time stamp on the file should change. But, even though iCal has been updated several times (including last week) since I bought the machine, the time stamp on the files show that the files were last modified in Jan. 2007. This cannot be unless Apple deliberately manipulates the time stamps. That makes it extraordinarily hard to determine what’s been updated and when.

In poking around though, I did find an application that’s sort of hidden away as part of iCal called /Applications/iCal.app/Contents/Resources/iCalAlarmScheduler.app

I suspect from the name and the files that, in all likelihood, this is where my problem lies. This is a program that, from what I understand, is supposed to be running in the background but I don’t see it running.

Even though the files show that this is the latest version for Mac OS X.4 (2.0.5), the files still show Jan 2007 as the last write date. Hm. It’s possible that something got corrupted during an update and so not everything is what it should be. That could explain why it’s not running - it’s corrupted. I’m going to hack around a little more and see if I can get this to run and see if it solves the problem.

But, considering that I’m not quite sure what’s going on, I’m very hesitant to try and put an older version of iCal on the system without completely and correctly removing the current version. But that probably means losing all of my calandar data - events and alarms and any notes. Without knowing where the problem is, I can’t be sure that putting a clean version of iCal on and then reading in the data from a backup that I won’t reintroduce the problem because the problem is caused by something in the data.

Yes, I realize that that until I do start from scratch that there’s no way to know. But, I’m not sure I can lose the data since it holds information about projects and meetings and schedules and…

Anyway, at this point, if iCalAlarmScheduler isn’t the problem, I think I might have to either live with it, or hope that when I install Leopard that iCal 3.0 fixes the problem.

If someone has additional suggestions, feel free to post…

Hi,

I think there’s not much more we can do to help if your iCal is truly broken. I don’t believe Apple will deliberately obfuscate (your term) things if what it does is destroy the user’s application. When your file does not get date-stamped properly when modified, it is inconceivable that Apple programmers would have wanted it that way. It’s just diametrically opposed to the normal way of doing things.

Yes, I’ve seen that iCalAlarmScheduler before in an older version of iCal. When I inspected the package for iCal that came with Leopard, I could not see this anymore. The same feature is likely implemented differently.

I hope the true iCal gurus in this forum could help you with your problem if there is a possible solution to it.

Good luck.

archseed :slight_smile:

You should be able to save your current calendar to prevent data loss. In iCal, choose File>Export. and you can save all your calendar info to a text file. This can later be imported into iCal to restore your data.

It is very odd that your iCal wasn’t fixed along the way to upgrading to 10.4.11! I don’t think that there will be an easy resolution to this problem short of reinstalling the system and then restoring your apps/data from a backup. (ouch… I feel your pain). Good luck.

Vince

Well, I’ve tried everything I can think of including suggestions made here. Still having problems with iCal and alarms. In addition to the problem with getting alarms when the machine is off, it now seems as if I get alarms tied to ToDo items AFTER the item has been marked “completed”. I think iCal is the worst piece of braindead software I’ve seen in a long, long, time.

I’m currently looking for alternatives…

If anyone has suggestions please feel free to post.