Sitemap

Amicuk Programming Answers

Error deleting events in iCal using applescript

2015-10-11   Views:4

Advertisement

Hi, I made a little applescript to insert and remove a roster in iCal for me and my collegues. While the script to remove a roster works fine on my computer, others are getting an error: see Link: [http://i359.photobucket.com/albums/oo31/Bronco_Dappe

Hi,
I made a little applescript to insert and remove a roster in iCal for me and my collegues.
While the script to remove a roster works fine on my computer, others are getting an error:
see Link: [http://i359.photobucket.com/albums/oo31/Bronco_Dappe/Allerlei/Afbeelding1.png]
[the error contains some strange characters but in general it says:
"can not get class ... of event id ... of calendar id ..."]
My applescript to delete the roster is:
on run {CalendarName, Start, Eind, Prefix}
-- Start and Eind format:
-- int(day) int(month) int(year) int(hour) int(minutes)
-- ===============================
on run
set CalendarName to "MP"
set Start to "15 10 2009 00 00"
set Eind to "17 10 2009 23 59"
set Prefix to "MP:"
-- Version 3.0
-- ========
-- Changed format of Start & Eind to be compatible with Snow Leopard
-- convert DateStart
set wordsplit to (words in Start)
set DateStart to (current date)
set year of DateStart to (item 3 of wordsplit)
set time of DateStart to 0 -- reset time
set day of DateStart to 1 -- prevent february 31
set month of DateStart to (item 2 of wordsplit)
set day of DateStart to (item 1 of wordsplit)
set DateStart to DateStart + ((item 4 of wordsplit) * hours + (item 5 of wordsplit) * minutes) -- set time
-- convert DateEind
set wordsplit to (words in Eind)
set DateEind to (current date)
set year of DateEind to (item 3 of wordsplit)
set time of DateEind to 0
set day of DateEind to 1
set month of DateEind to (item 2 of wordsplit)
set day of DateEind to (item 1 of wordsplit)
set DateEind to DateEind + ((item 4 of wordsplit) * hours + (item 5 of wordsplit) * minutes)
tell application "iCal"
set TargetCalendar to first calendar whose title is CalendarName
set list2bDeleted to {}
set list2bDeletedSum to {}
set listEvents to every event of TargetCalendar
repeat with singleEvent in listEvents
if summary of singleEvent starts with Prefix then
set eventstart to start date of singleEvent
if eventstart ≥ DateStart and eventstart ≤ DateEind then
if summary of singleEvent starts with Prefix then
copy uid of singleEvent to end of list2bDeleted
copy summary of singleEvent to end of list2bDeletedSum
end if
end if
end if
end repeat
repeat with eventUID in list2bDeleted
delete (every event of TargetCalendar whose uid is eventUID)
end repeat
end tell
return list2bDeletedSum
end run
In general the script works like this:
1. it goes over events in a specified calendar
2. all events to be removed are added to a delete-list by id
3. all events in the delete-list are removed using this id
it seems step 3 creates a problem.
any suggestions here?
ghislain
Message was edited by: ghis74

The replay answer
Advertisement
Once I got access again to an apple with Leopard I solved the problem.
The applescript was saved in Snow Leopard.
When opened in Leopard 'uid' in 'copy uid of singleEvent to end of list2bDeleted' was changed into '<<class>>' : 'copy <<class>> of singleEvent...'.
Quite strange - but correcting and saving the script in Leopard solved the problem.
Thanks for your help.
Ghislain

Go to See the other 3 answers

Error deleting events in iCal using applescript

Category:DefaultRelease time:2015-10-11Views:130

Hi, I made a little applescript to insert and remove a roster in iCal for me and my collegues. While the script to remove a roster works fine on my computer, others are getting an error: see Link: [http://i359.photobucket.com/albums/oo31/Bronco_Dappe[More]

Deleting event in iCal 5.0.1 not syncing with Google Calendar

Category:DefaultRelease time:2015-10-11Views:130

When I delete an event from iCal, it does not sync with Google Calendar.  However, when I create an event in iCal, it syncs just fine with Google Calendar. Creating and deleting events from Google Calendar syncs fine with iCal.  Has anyone else exper[More]

Bugs with Lion! Cannot delete events in iCal and other stuff...

Category:DefaultRelease time:2015-10-11Views:130

First, sorry for my English, I speak French... I installed Lion on my MacBook Pro, my iMac and on my girlfriend's MacBook Pro and I have the same problems on each computer! Help please! I try to delete an event on iCal and it always comes back!! I ca[More]

How to delete events on iCal that were created many years ago with a MobileMe account?

Category:DefaultRelease time:-0001-11-30Views:130

I have never ending recurring events on iCal that I created years and years ago with my MobileMe account.  I don't have access to that email anymore, unfortunately.  Is there any way to get rid of these silly things?Navi, What Calendars are listed in[More]

Trouble with a script that deletes event in iCal

Category:DefaultRelease time:2015-10-11Views:130

Used this script over the summer and it worked fine. Can't figure out the issue now, but it isn't working. Here is a few lines of the output I get and then the error I get is at the bottom. I'll post the full script at the bottom of this posting. Err[More]

How to delete events in ical?

Category:DefaultRelease time:2015-10-11Views:130

When I save an appointment in ical on my imac in the icloud section and then want to delete it, it's not possible. Anyone any tips? I have Lion installed and didn't have this problem before...use the following article to delete an icloud calendar eve[More]

How to delete events in iCal on Mac, but not from iPhone

Category:DefaultRelease time:2015-10-11Views:130

Hi everyone, I have a reminder set to my phone for something everyday which is great because it's the first thing I look at in the morning. But I don't want this event plastered all over my iCal on my computer as it's unnecessary to see it there. But[More]

Cannot delete event in ical

Category:DefaultRelease time:2015-10-11Views:130

I have repeated events that have gone wild in my ical. The events show up doubled on the wrong dates and I cannot click on them to delete or edit them-any virus I should know of? I am still on Leopard and have not dared messing with icloud yet either[More]

How do you delete an event in iCal?

Category:DefaultRelease time:2015-10-11Views:130

I have an iPad 2 and I cannot delete events from iCal. Does anyone know how to do this? iPad 2 seems very unstable after the latest software update on 9 May 2011.Click on the event, and use the delete key. Or click on the event, and choose iCal>Edit>[More]

Error while deleting events from the integration event queue

Category:DefaultRelease time:2015-10-11Views:130

I am trying to delete all the events from the integration event queue after reading it, like this (this is in Java):         IntegrationEventWS_DeleteEvents_Input input = new IntegrationEventWS_DeleteEvents_Input();         input.setDateTime("")[More]

Delete events without notifying

Category:DefaultRelease time:-0001-11-30Views:130

Is there any way to delete events in iCal without notifying recipients? I not only get duplicate calendar items sometimes, but spam messages with ical events. Do I really need to notify spammers that they've got a valid email address? It's either tha[More]

Hot
We are using XML publisher 5.0 with Oracle Financial Applications. We have defined Viewer Options for Excel as File Format=Excel, Mime Type=application/vnd.ms-excel. The problem is when we use web based View requests, the excel comes up with XML code [More]
I've created a front panel that consists of booleans. When one is chosen it will open a different subsequence in Teststand, and then walk the user through the appropriate test. The problem is, what if the user hits the wrong button and decides he doe [More]
hi, i have just updated maps to 3.04,ive had a look in app mngr and there is all this glup that i probably dont need and would just like to get some space back for phone.i have deleted the share location stuff,but wondred if there was anything else i [More]
Hi guys, I am working on my final term paper at university with the MiniSAP Netweaver 7.2 Trial Version but after a month using it I am having some troubles. 1 - I can not access minisap (system NSP) with BCUSER because the license is not valid. 2 - [More]
When running the following command using ODP.Net 10.1.0.301 I recieve error 1036. Statement runs fine within SQL+ and Toad. Dim SQL As String = "SELECT CASE WHEN EXISTS(SELECT part_nbr FROM item_master WHERE part_nbr=:part_number) THEN 1 ELSE 0 END A [More]
Today I was foolish enough to install the new firmware settings. the immediate effect was to remove me from the internet. I have tried factory reset and resetting the network but to no avail. Network diagnostics shows the status of settings OK except [More]
Hi All, I would like to create a link "Change Password" for end users to able to change their password anytime. I've followed the link below Self Reset Password but it still require the admin login before end users can change their password. The [More]
Hi, In one of my experiments, the data I acquire in different channels have different magnitudes (in Volts). Therefore, I am trying to set a different input range to these various channels. Here's a picture (input_range.png) of a part of my VI where [More]
I wanted to investigate the CVS - Create Local Repository option as demoed in: http://www.oracle.com/technology/products/jdev/101/viewlets/101/cvs_viewlet_swf.html However the menu option is not enabled. I assume I'm correct in understanding that JDe [More]
what is the solution following error RMAN> list backup summary; using target database control file instead of recovery catalog RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOL [More]