Why does creation / modification date not change on repeating tasks? [Red herring]

I have an AppleScript that reads the creation or modification date of a task.

 if (pShowDaysInBox) then
     set itsModDate to the creation date of ListItem
     tell application "Finder" to set theDaysInBox to ¬
       -1 * (((theDateToday - itsModDate) / (60 * 60 * 24)) as integer)
 end if

When I run this on a task that has been generated from a repeating task, the date seems always to be the date of the originating task. I was expecting it to be the date of the newly generated task.

IOW, suppose I created a task last week that is to repeat weekly and I complete it today. The new iteration of the task shows a creation or modification date as last week, not today. Also, I can check creation date or modification date and I get the same thing.

Why?

ps: In case it makes a difference, the task is actually inside of an Action Group that itself repeats monthly upon completion. I have not confirmed this behavior is actually the same for individual tasks that repeat, though I seem to recall that it was.


JJW

This is really interesting! I’m not seeing this behavior in OmniFocus 2.2.1 on Mac. (I’m only checking the “Added” and “Changed” dates in the sidebar inspector, but it looks like the Added date in the UI comes from the same property as the one exposed through AppleScript’s creation date.)

I checked this behavior with both a single repeating task and a repeating action group containing a non-repeating child, and I can’t reproduce your described issue with either. I assume you’re on OmniFocus 2.2 or 2.2.1 for Mac? Is any other script changing the dates here? These properties are mutable with AppleScripts while a task is still being inserted; if something is running to clone or otherwise insert repeated tasks into your database, it could be changing the Added or Changed dates right up front.

I’ve uploaded a video showing my test over on Vimeo. Please let me know if I’m misunderstanding your problem!

1 Like

OK. I apologize. The problem was on my side. I saw a set of results from actions with what I thought were unrealistic modification dates, e.g. 94 days ago. I tracked this back to the fact that I had deferred the offending action for 3 months (and others for 1 month and so on). So, by the time the AppleScript picked up the results, the action really had been sitting for that long.

Thanks for the notice about the update. I would have missed it otherwise (and continued blissfully on 2.1.x).


JJW

2 Likes