Hi guys! I’m trying to make a script to run on the first of every month (through cron) to create To Do’s. But I’m having trouble passing a date to iCal. Any help would be appreciated!
Here is the code so far…
-- doesn't create duplicates. adds todo's to calendar "Personal"
on createTodo(summaryText)
set now to current date
set midnight to now - (time of now)
tell application "iCal"
-- don't create an item if it already exists for today!
if (count (every todo in calendar ¬
"Bills" whose due date ≥ midnight ¬
and summary = summaryText)) < 1 then
make new todo ¬
at end of calendar ¬
"Bills" with properties ¬
({due date:now, summary:summaryText})
end if
end tell
end createTodo
createTodo("Pay Rent")