Oops!
I left a line in that restricted the checks to just the first 100 events
done to speed up the testing. Here¹s the full script without the limitation.
set logFilePath to ((path to library folder from user domain) as text) &
"Logs:com.barryw.CalendarConflictCheck.log"
try
set logFile to open for access logFilePath with write permission
set eof logFile to 0
on error errmess
display dialog "an error ocurred:" & return & errmess buttons {"OK"}
default button 1 with icon stop
close access logFilePath
beep
return
end try
tell application "Console" to open logFilePath
set t1 to current date
write "+++++++++++++++++++++++++" & return to logFile
write "Calendar Confilct Checker Script" & return to logFile
write "Script Run started: " & t1 & return to logFile
write "+++++++++++++++++++++++++" & return to logFile
tell application "Microsoft Entourage"
if not (exists category "Calendar Conflict") then make new category with
properties {name:"Calendar Conflict", color:{60928, 0, 0}}
set timedEvents to every event whose all day event is false
set eventCount to count timedEvents
write "Events to check: " & eventCount - 1 & return to logFile
repeat with x from 1 to eventCount - 1
write "checking event " & x & " - " & (get subject of item x of
timedEvents) & return to logFile
tell item x of timedEvents to set {Sx, Ex} to {start time, end time}
repeat with y from x + 1 to eventCount
tell item y of timedEvents to set {Sy, Ey} to {start time, end
time}
if ((Sy < Ex) and (Sy „ Sx)) or ((Ey > Sx) and (Ey ¾ Ex)) or
((Sy < Sx) and (Ey > Ex)) then
set category of item x of timedEvents to {category "Calendar
Conflict"} & category of event x
set category of item y of timedEvents to {category "Calendar
Conflict"} & category of event y
end if
end repeat
end repeat
end tell
set t2 to current date
write "+++++++++++++++++++++++++" & return to logFile
write "Script Run ended: " & t2 & return to logFile
write "time taken: " & t2 - t1 & " seconds" & return to logFile
write "+++++++++++++++++++++++++" & return to logFile
close access logFile
--
Barry Wainwright
Microsoft MVP (see
http://mvp.support.microsoft.com for details)
Seen the All-New Entourage Help Pages? - Check them out:
<
http://www.entourage.mvps.org/>
From: Barry Wainwright <
[email protected]>
Newsgroups: microsoft.public.mac.office.entourage
Date: Thu, 28 Apr 2005 16:58:42 +0100
Subject: Re: Entourage 2004 Calendar Conflict Notification?
Has anyone written a script for Entourage 2004 to check for calendar
scheduling conflicts? I think it is one of the products glaring omissions on
an otherwise excellent product.
It is quite possible to set up a script to do this (and relatively easy),
but it could be dreadfully slow...
This script will assign a category ³Calendar Conflict² to all such events
and you could then search for this category with an advanced find or a
custom view.
It will run very slowly though if you have 100 timed events it has to up
to 30,000 comparisons!
Save the script as a compiled script & put it in the ŒEntourage Script Menu
Items¹ folder in your ŒMicrosoft User Data¹ folder. The script can be
manually run from the menu or called as an action in a mail rule.