Script for iCal

Does anyone has a script in order to create todos in Ical directly from DevonThink? I am not practical with scripts.

Thanks in advance :smiley:

Hello,

I use the following script:


tell application "iCal"
		activate
		set newtodo to (make new todo at end of todos of calendar "myCalendar")
		tell newtodo
			set priority to high priority
			set summary to "myText"
		end tell
	end tell

Best regards,
Christophe

Thanks. It works fine! :smiley:

Hi,

Thank you for the script.

This opens iCal for me but doesn’t create anything. I tried when some text was selected in a new rtf in DTP and when there was nothing selected.

advice?

Any help will be appreciated.

Hi,

I didn’t post my entire script because there’s too much customization in it.

But you need to fill your variables first. Something like:

display dialog "New task : " default answer ""
set myText to the text returned of the result
tell application "iCal"
	activate
	set newtodo to (make new todo at end of todos of calendar "My Calendar")
	tell newtodo
		set priority to high priority
		set summary to myText
	end tell
end tell

Replace “My Calendar” by your own calendar name.
Christophe

Works.

thank you
:slight_smile: