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!)
I also tried restarting the application, then my Mac in an attempt to magically solve the issue.
The issue seems to gravitate around adding the timestamp on start (?).
Ooh hmm, interesting, this does look like a bug! Could you screenshot the Plug In console?
It can be brought up here, under Automation > Show Console
Then click Effacer to clear out anything that was already there, and select a task. If thereâs a problem it should show some red text in the console.
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.
Iâve corrected the issue in version 1.2! The update can be downloaded from the same spot: https://graypegg.com/posts/omnifocus-timer#installation Just double click the .omnijs file and omnifocus should ask if youâd like to update to 1.2.
I had the same issue with the stop timer button using 1.2 and when I opened the OF automator console and cleared everything it also started working fine.