Re: iCal Notifications
Re: iCal Notifications
- Subject: Re: iCal Notifications
- From: John M <email@hidden>
- Date: Wed, 11 Jan 2006 08:45:55 +0000
Jim Hankins wrote:
Anyone know how to delete iCal notifications? Actually I'd like to
delete them all. I have over 400+ due to a isync that created the
notifications because the email address within the appointment does
not correspond to any email address my address book.
I'm assuming you mean events and that you only want to delete
duplicates. I had the script below lying around.
Best wishes
John M
-- Delete duplicates from iCal v2 --
-- Applescript -- John Maisey 27/5/5 --
-- Modified 2/6/5 --
-- Duplicates being events with same title and start time in one
calendar--
tell application "iCal"
set sourceCal to first calendar whose title is (item 1 of (choose
from list (title of (every calendar) as list) with prompt "Choose
calendar to delete duplicates"))
set testThen to (current date) -- time tester
set mySumms to summary of events of sourceCal
set myStarts to start date of events of sourceCal
set myUIDs to uid of events of sourceCal
end tell
script myStuff
property aSumms : {}
property aStarts : {}
property aUIDs : {}
property aDeletes : {}
end script
set myStuff's aSumms to mySumms
set myStuff's aStarts to myStarts
set myStuff's aUIDs to myUIDs
set myStuff's aDeletes to {}
set myLength to length of myStuff's aStarts
repeat with aNum from 1 to (myLength - 1)
set thisSumm to (item aNum of myStuff's aSumms)
set thisStart to (item aNum of myStuff's aStarts)
repeat with bNum from (aNum + 1) to myLength
set thatSumm to (item bNum of myStuff's aSumms)
set thatStart to (item bNum of myStuff's aStarts)
if thisSumm is equal to thatSumm and thisStart is equal to
thatStart then
set the end of myStuff's aDeletes to (item bNum of myStuff's aUIDs)
exit repeat
end if
end repeat
end repeat
set n to count of myStuff's aDeletes
tell application "iCal"
repeat with myDel in myStuff's aDeletes
delete (every event of sourceCal whose uid is myDel)
end repeat
display dialog (n & " duplicates deleted in " & ((current date) -
testThen) & " seconds") as text -- time tester
end tell
--
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden