The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniFocus Extras (http://forums.omnigroup.com/forumdisplay.php?f=44)
-   -   Logging OmniFocus done items to DayOne through Hazel (http://forums.omnigroup.com/showthread.php?t=27370)

RobTrew 2012-12-10 02:41 PM

Logging OmniFocus done items to DayOne through Hazel
 
A draft shell script which can be triggered by [URL="http://www.noodlesoft.com/hazel.php"]Hazel[/URL] whenever a change is detected in the OmniFocus Sqlite cache, and which logs OmniFocus done items to the [URL="https://itunes.apple.com/us/app/day-one/id422304217?mt=12"]Day One[/URL] journal application.

[URL="https://github.com/RobTrew/tree-tools/blob/master/OmniFocus%20scripts/Shell%20scripts%20for%20Geektool%20or%20logging/2012-12-10-omnifocus-done-to-DayOne-shellscript.md"]View description page[/URL]

[URL="https://github.com/RobTrew/tree-tools/blob/master/OmniFocus%20scripts/Shell%20scripts%20for%20Geektool%20or%20logging/OmniFocusLogDone2DayOne.sh"]View script[/URL]

[COLOR="White"]--[/COLOR]

Greg Jones 2012-12-11 01:36 AM

Greetings Rob, I installed the shell script, setup the Hazel rule as pictured, and set the Day One preferences to what you suggested. However, none of my completed tasks for today have (yet) been logged to Day One. Wondering if I have missed a step here? Looking at the shell script, there are references to a log folder and 3 log files-do these need to be set up manually or?

RobTrew 2012-12-11 01:55 AM

[QUOTE=Greg Jones;118244]Greetings Rob, I installed the shell script, setup the Hazel rule as pictured, and set the Day One preferences to what you suggested. However, none of my completed tasks for today have (yet) been logged to Day One. Wondering if I have missed a step here? Looking at the shell script, there are references to a log folder and 3 log files-do these need to be set up manually or?[/QUOTE]

Hi Greg,

That's interesting - thanks for the report.
No, no need to set up log files, and the default log folder is your home directory.

Things to check:[LIST=1][*]Is it creating ~/DoneToday.txt etc ?[*]Have you clicked the Done button in DayOne to clear any active editing session and reveal any text from other entry-creating events ?[*]Have you definitely copied the whole of the script and either pointed Hazel to a file containing it, or pasted it all into Hazel's 'Embedded Script' field ?[*]If it is creating the ~/DoneToday.txt etc files, what's in them? I wonder if there's a time zone issue which I haven't got right. I happen to be sitting here on an edge case - Greenwich Mean Time ...[/LIST]

Greg Jones 2012-12-11 02:52 AM

[QUOTE]Is it creating ~/DoneToday.txt etc ?[/quote]
Yes, I have all 3 files in my home directory

[quote]Have you clicked the Done button in DayOne to clear any active editing session and reveal any text from other entry-creating events ?[/quote]
Yes, have done this. I've tried completing a task when Day One was active, and completing a task when Day One was not running. No difference-there is no entry for the completed tasks.

[quote]Have you definitely copied the whole of the script and either pointed Hazel to a file containing it, or pasted it all into Hazel's 'Embedded Script' field ?[/quote]
I downloaded everything from your github page using the Download button and pointed the Hazel rule to the OmniFocusLogDone2DayOne.sh shell script. The script is version 0.02.

[quote]If it is creating the ~/DoneToday.txt etc files, what's in them? I wonder if there's a time zone issue which I haven't got right. I happen to be sitting here on an edge case - Greenwich Mean Time ...[/QUOTE]
The DoneToday and LoggedToday text files contain the completed tasks in the format:

cjetMpZGO96|2012-12-11|05:03|task project and task name
kWaHO1dkp49|2012-12-11|06:45|task project and task name

The JustDone text file is empty, and my time zone is Easter Standard.

RobTrew 2012-12-11 03:05 AM

Thanks ! If DoneToday.txt contains your done items, then the problem is with the logging to DayOne, rather than the harvesting of done items, and I realise that my covering notes (now [URL="https://github.com/RobTrew/tree-tools/blob/master/OmniFocus%20scripts/Shell%20scripts%20for%20Geektool%20or%20logging/2012-12-10-omnifocus-done-to-DayOne-shellscript.md"]amended[/URL] with the help of your feedback) omitted to mention that you need to install the DayOne [URL="http://dayoneapp.com/tools/"]command line tool [/URL]

Might that be the issue ?

Greg Jones 2012-12-11 03:25 AM

That would indeed be the issue. I wondered why your script referenced a CLI tool for Day One-just assumed it was part of the .app package.

It is working here now-thanks! Just to confirm the expected behavior, should there be a separate entry in Day One for each completed task?

RobTrew 2012-12-11 03:49 AM

[QUOTE=Greg Jones;118250]It is working here now-thanks![/QUOTE]

Good ! Thanks for the help with finding gaps in the documentation.

[QUOTE=Greg Jones;118250]Just to confirm the expected behavior, should there be a separate entry in Day One for each completed task?[/QUOTE]

The CLI makes one entry per event. My understanding of Hazel is that it is driven by events rather than intervals. If you select a bunch of tasks and mark them all as done, in a single event, they will end up in one entry.

If, however, you move through the page, ticking them off one by one, they will probably end up in different entries.

Might be worth experimenting, if you would prefer more clustering, with Hazel settings like "If the date last modified is in the last 10 minutes". I'm not sure exactly what the implementation of that is.

A line like:
[CODE]afplay /System/Library/Sounds/Pop.aiff[/CODE]
after the DayOne command line is called may help diagnosis.

[COLOR="White"]--[/COLOR]

RobTrew 2012-12-11 04:29 AM

Something like this seems to yield sparser and more aggregated logging events, if that seems preferable:

[IMG]https://raw.github.com/RobTrew/tree-tools/master/OmniFocus%20scripts/Shell%20scripts%20for%20Geektool%20or%20logging/HazelLoggingIntervals.png[/IMG]

(But you may need to add a separate and additional ruleset for the same folder to log at one or more fixed times every day, 14:00 and 23:00 for example, to ensure that any remaining unlogged items are processed).

[COLOR="White"]--[/COLOR]

Greg Jones 2012-12-11 04:42 AM

Yes, I'm going to play around with this and see if I can get a more condensed entry. I just entered some dummy tasks from the desktop, closed OF, and checked them off over the last 30 minutes from OF iPhone. When OF Mac was launched again, I got a nice list in on Day One entry, sorted by project and by time within the project. I can make use of this!

[img]http://f.cl.ly/items/2u0S1i141M1Q093X2P04/Screen%20Shot%202012-12-11%20at%208.39.01%20AM.png[/img]

RobTrew 2012-12-14 05:36 AM

[URL="https://github.com/RobTrew/tree-tools/blob/master/OmniFocus%20scripts/Shell%20scripts%20for%20Geektool%20or%20logging/2012-12-10-omnifocus-done-to-DayOne-shellscript.md"]Version 3[/URL]:
[LIST=1][*]Makes the final colon of the project line into a live link from Day One back to the project in OmniFocus[*]Corrects the formatting of items marked as done while still in the Inbox.[/LIST]


All times are GMT -8. The time now is 12:37 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.