How can I set the check-box "completed" in a todo ?

Hi All,
I notice a strange behaviour.
From iCal dictionary I read that there isn’t a status property among the properties of todo class.
But if I put the flag on the check-box “completed” of a todo and then I edit the “corestorage.ics” file of my calendar I find a row called “STATUS:COMPLETED”.

Among the properties of an event there is a status one and the value are: cancelled, confirmed, none e tentative.
This status property has nothing to do with the status “completed” of a todo.

How can I set the check-box “completed” in a todo or can I get the status of this check-box ?

Please let me know the exact syntax…I’m going mad…

G.

Thank you a lot Jacques!!

Now If you are so kind to tell me another trick…

Now I can set my check-box and I am very happy but if I would unchecked this one…

Please let me know this new trick…

G.

IMHO this is not possible.

Just this morning I wrote a quick&dirty script to list all to do’s, which are not yet completed.
I figured out, that if completion date (and also due date) has no value, it is complete empty, even if you assign a variable
with an empty completion date, you get NOTHING (I assume, that’s a bug).
This makes it impossible to assign an empty value or missing value or “” to completion date

The only way to get the data is to throw a couple of errors.
Here is the script, if you are interested in:

tell application "iCal"
	set todolist to "Unerledigte Aufgaben" & return & return
	repeat with i in every calendar
		if (count todos of i) > 0 then
			repeat with ii in todos of i
				try
					completion date of ii is missing value
				on error
					try
						set dd to due date of ii
						set dd to short date string of dd & " " & hours of dd & ":" & minutes of dd
						if character -2 of dd is ":" then set dd to dd & "0"
					on error
						set dd to tab & tab & tab
					end try
					set todolist to todolist & summary of ii & tab & dd & tab & description of ii & return
				end try
			end repeat
		end if
	end repeat
end tell

tell application "TextEdit"
	if not (window 1 exists) then make new document
	set text of document 1 to todolist as Unicode text
end tell

Hi Stefank,

You might be able to get missing value from the properties of a todo.

tell application “iCal”
set the_cal to first calendar whose title is “Home”
set p to properties of first todo of the_cal
completion date of p
end tell

I don’t think you can set it though.

Edited: BTW, what I would do is make a new one, with a new due date.

gl,

Hi kel,

this is interesting to get different results addressing the properties record and the property directly.
As written before I guess that’s a bug. And setting it doesn’t work neither :confused:

what if im trying to set the checkbox to completed for new to-dos if they are older than yesterday?