I recently started having to track time on a task + project basis. Was able to throw together a plugin for it, though I have messed around with a few things. I wanted timers to work across devices and to store the time elapsed in Estimated Duration. (reasoning for that included on the article I linked)
So timers are date stamps added to the notes section in a small attachment (Set up that notes section attachment as a library, not sure how good of an idea it is, but it adds generic fields to tasks, which is helpful.) and when you “stop” the timer, it just uses the difference between now and the timestamp.
Thank you @toish! I can start timers and refresh estimated durations, but I can’t stop them (action and menubar icon not available). Estimated durations are always 0minutes. I’m new to scripting, I can’t find potentially obvious solutions by looking among the plugin files. Any ideas? (My uneducated guess is it has to do with my Omnifocus being in French) Thanks!
Hi @ManunaM! The stop timer button first checks to see if there’s a file on the selected task called “db.json” (you should see it in the notes if you started a timer.) and then checks if it contains a timestamp. You should be able to double click on db.json in the note on a task with a running timer to see that. If you see db_1, it’s a known issue. I’m doing some non-standard stuff with attachments to make it work, so sometimes the plugin creates 2 different files. I found deleting both, restarting OmniFocus, and starting the timer fixes it. (Was something that only happens to me right after installing. I’m working on solving it!)
Currently I have it rounding down to the closest minute, so a timer stopped in under 1minute will become “0minutes” when added to the OmniFocus database.
(Feel free to reach out to me in French, I also have my OF database in French!)
Merci @toish. J’ignore si le forum fait des traductions automatiques, je vais donc continuer en anglais pour le bénéfice de tous.
Once I started a task, the db.json file looks like the screen captures below. My understanding is that there is no timestamp. Also, the file is db6 in this case, since I tried several times in various tasks (not sure if this relates to the issue you mentioned).
Ah! Thanks for getting a screenshot, that is a bug! I think the reason this wasn’t working was the error occuring here never actually meant anything got returned when seeing if the button should be enabled or disabled.