AppleScript to add week numbers in Entourage

Just finished an AppleScript for Entourage 2008 to add week numbers to the default calendar.
The script actually creates all-day events with each set to “Free” status and includes each Sunday’s [ordinal date](http://en.wikipedia.org/wiki/ISO_8601#Ordinal_dates).
numberedweeks.jpg


While the script isn’t very long, it was a learning experience. I like to use handlers in AppleScript so that I can create a list of actions first and then write the code later. But I ran into a very strange problem doing this. I could add the script to the Entourage Script Menu Items list and run it once. Every subsequent run would fail. This happened until I recompiled the script and regardless of whether or not I ran the script from within Entourage or from the Script Editor.
The fix was simple. I removed the handlers and created a straight-through script that runs from top to bottom. Doing so only took a few minutes and then the script began running reliably.
I’ve sent it to Diane to test.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s