Applescript: Loop through all open tasks
Sorry for asking that basic question, but I looked through the whole forum and have not found an answer to this:
how can I loop through ALL tasks of the whole database - not just the tasks of a perspective or a project, and not just the tasks I previously selected. What I'd like to do: Some tasks I import (from mail or OmniOutliner) possess a due date that is set to midnight. I'd like to run a script every day that changes the due date to some time in the early evening. It would be nice if someone could give me a hint for that. Thanks for your help. |
Assuming that you are bringing the time ahead, rather than deferring it to the morrow, perhaps something roughly like this:
[CODE]set plngHours to 19 -- e.g. 7pm tell application id "OFOC" tell default document set lstTasks to flattened tasks where (due date is not missing value) repeat with oTask in lstTasks set dteDue to due date of oTask if hours of dteDue = 0 and minutes of dteDue = 0 then set dteDue to (dteDue - days) -- previous day set hours of dteDue to plngHours set due date of oTask to dteDue end if end repeat end tell end tell [/CODE] [COLOR="White"]--[/COLOR] |
Hello RobTrew,
fantastic! That is exactly what I was looking for. Thanks very much for your great help! |
All times are GMT -8. The time now is 08:19 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.