AppleScript Deleting Calendar
Hello everyone,
I have a quick question regarding AppleScript.
I got multiple calendars "Untitled 1" "Untitled 2" etc. this goes up to "Untitled 325".
I wanted to run a small Apple Script, which would remove those for me automatically.
For that I wrote this one:
tell application "iCal" to activate
repeat
tell application "iCal"
if exists calendar "Untitled" then
delete calendar "Untitled"
else
delete calendar "Untitled"
end if
end tell
end repeat
The problem is, as you can see that it really just search for "Untitled" calendar names, it does not search for the others and won't delete them either. I tried then several way for example using a * after Untitled or a empty space then a * etc. I have also googled for a command which could help me but I was not successful.
It would be great, If anyone could tell me how to tell this Script to delete any calendar which start with "Untitled".
I'm looking forward for feedback! Thanks in advance.
iPhoneRockets