Entourage - send automatic email with weekly diary

I’m a novice here but I’m trying to figure out a way to send an automatic email (to a specified addres) on a regular basis to give diary events for the forthcoming week. Any pointers on how to do this?

thanks

Ingram

Where are the diary events stored? Are they calendar events stored inside of Entourage? Do they have a specific category applied to them? You could create a script that checks the calendar for the next week looking for events that have a specific category and grab the details of them for inclusion in an email. Then, you can create a scheduled event in Entourage that runs the script once a week (or as frequently as you need). A little more information is required before we could offer any type of working solution.

Jon

Hi Jon, thanks for your reply. Yes, they’re diary events in entourage stored under the “work” category. I guess the tricky bit is how to ‘grab’ these data for inclusion in an email. I’ve tried to find scripts which do similar task but haven’t found anything as yet.

many thanks

Ingram

Create a new script with this content (updating the properties as necessary):

property the_subject : "This Week's Events"
property to_name : "John Doe"
property to_address : "john@doe.com"

tell application "Microsoft Entourage"
	set current_date to (current date)
	set work_category to category "Work"
	set work_events to events where work_category is in its category and (current_date + (7 * days)) ≥ its start time and current_date ≤ its start time
	set email_content to {}
	repeat with i from 1 to (count work_events)
		tell item i of work_events to set end of email_content to {start time, " - ", subject, return, content, return, return}
	end repeat
	set new_message to make new draft window with properties {subject:the_subject, content:email_content as Unicode text, to recipients:to_name & " <" & to_address & ">"}
	send new_message
end tell

Now, in Entourage, make a new schedule event (not in the calendar, but from the “Schedules” item from the “Tools” menu), set it to run every Monday morning (or whenever) and set the action to “Run AppleScript” and choose the script you saved. That should do it.

Jon

Hi Jon, this works really well. Thank you very much. Its neat and effective. The only slight quibble I have is that the events don’t always seem to be listed in the correct order - does entourage read them off in date order or some other order (e.g. when they were inserted?). Also, I wonder if it picks up recurring events that may have started some time ago but include an event within the sepcified week. These are minor issues for me and it’ll be a real help.

all the best

Ingram