Re: iCal: Clearing Dates from a Todo
Re: iCal: Clearing Dates from a Todo
- Subject: Re: iCal: Clearing Dates from a Todo
- From: Paul Berkowitz <email@hidden>
- Date: Sat, 18 Mar 2006 13:03:37 -0800
- Thread-topic: iCal: Clearing Dates from a Todo
On 3/18/06 11:38 AM, "Todd Geist" <email@hidden> wrote:
> Hello,
>
> I would like to be able to clear the due dates and completion dates
> for a todo in ICal
>
> If It try this
>
> tell my_todo
> delete completion date
> End tell
> --> the date changes to Today (or the Creation Date not sure which)
> and the check box remains checked.
>
> If I try
>
> tell my_todo
> set completion date to ""
> End tell
>
> or
>
> tell my_todo
> set completion date to null
> End tell
> --> an error on that one line
The first attempt is never going to work, since 'completion date' is a
_property_, not an element, of todo. You can never delete properties - you
can only set them to some value that corresponds to what you're looking for
in the UI.
The second example is never going to work, since the dictionary tells you
that the type for 'completion date' is 'date', not string. "" is not a date,
it's a string.
Just looking at the dictionary would tell you that these would never work.
The third attempt is on the right track. But I don't think there are any
apps that use 'null' as a default value. How would you know this?
Did you try getting the completion date of an event which has none?
Unfortunately, iCal being the sort of mediocre AppleScripted app that it is
(i.e., an Apple app), you get no result at all. But if you
get properties of last todo of calendar 1
after making a new todo in the first calendar and assigning no completion
date, you'll get a record of all its properties, and will see
completion date:missing value
there. So now try, on an event which already has a completion date, e.g.
set completion date of (first todo of calendar 1 whose summary is
"Test") to missing value
That kind of thing works for some apps (e.g. Address Book), but it does not
work here. You get an NSUnknownKeyScriptError.
Unfortunately, that means that you're going to have to get all the other
properties and elements (alarms of all types) of the todo, delete the todo,
then make a new one with all the same properties but no completion date
(just omit it from the record of properties) and then make new alarms at it
corresponding to its predecessor's. A horrible workaround. Not atypical for
iCal.
If anyone knows another way to expunge an existing completion date, please
let us know. Setting a future date doesn't bother it at all!
--
Paul Berkowitz
_______________________________________________
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