The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniFocus > OmniFocus Extras
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Logging OmniFocus done items to DayOne through Hazel Thread Tools Search this Thread Display Modes
Trying to run the .sh file does throw up some errors as below:

Last login: Mon Feb 11 18:04:34 on ttys000
unknown-44-4c-0c-e4-3e-2c:~ billwestwood$ /Users/billwestwood/Library/Scripts/OmniFocus/
/Users/billwestwood/Library/Scripts/OmniFocus/ line 1: {rtf1ansiansicpg1252cocoartf1187cocoasubrtf340: command not found
/Users/billwestwood/Library/Scripts/OmniFocus/ line 2: {fonttblf0fnilfcharset0: command not found
/Users/billwestwood/Library/Scripts/OmniFocus/ line 2: f1fnilfcharset0: command not found
/Users/billwestwood/Library/Scripts/OmniFocus/ line 2: f2fnilfcharset0: command not found
/Users/billwestwood/Library/Scripts/OmniFocus/ line 3: syntax error near unexpected token `}'
/Users/billwestwood/Library/Scripts/OmniFocus/ line 3: `}'
unknown-44-4c-0c-e4-3e-2c:~ billwestwood$

At least I know how to test it now!
My guess is that you may have saved this from TextEdit, which is fine, but TextEdit can save in two different formats:
  1. Plain text
  2. Rich Text (RTF)

Looks like you have saved it as an RTF file, which is legible to humans but not to command shells.

The trick is to make a fresh plain text copy,
TextEdit > Format > Make Plain Text ⌘⇧T
and then use the chmod +x command again to make it executable.

Good luck !
I'm sorry, this is taking up a lot of your time.
I saved the file as plain text via Word.
I'm still getting an error message:

Last login: Mon Feb 11 23:07:14 on ttys000
lj9hb3q1:~ billwestwood$ /Users/billwestwood/Library/Scripts/OmniFocus/
-bash: /Users/billwestwood/Library/Scripts/OmniFocus/ bad interpreter: No such file or directory
lj9hb3q1:~ billwestwood$
I think we have probably moved beyond OmniFocus issues to the question of how much one wants to learn about and the shell here.

It may be a bit ambitious to use shell scripts like this when the basics are still a bit unfamiliar. Probably best to start with some tutorial material - there's plenty on the web.

My first guess is that you may be saving from Word (possibly not first choice for shell script editing and testing) with the wrong kind of line-endings (Bash expects LF), but I'm afraid I may not have time to get into the forensics of that :-)

Good luck !
Okay, here's a simple, no-fuss approach.

Select the text of the script from the web page. Do Edit->Copy.

Go to the Terminal app. Type

cat > foo
press the Enter key
do Edit->Paste (all of the selected text should appear)
press the Enter key
press the control key and then without releasing it, press the d key.

You should get the shell prompt back at this point.
Now type

chmod +x foo
press the Enter key

Shell prompt again. At this point, feel free to use the Finder to rename the file.
That seems to have done the trick, thanks.
All I need to do now is filter out the tasks I want to record, but that shouldn't be too difficult.
I have the script working, the only problem now is that I can't trigger it from Hazel. If I drag the .sh file to Terminal & run it, the whole thing works fine, creating the DayOne & home folder items as expected. I have left the setup in Hazel as first described in Rob's article, I have added a prompt for a certain time, but either way nothing happens from Hazel.
Any ideas?
Bill, if you check all the steps that were mentioned here it should work. I believe you also mentioned the script didn't work when pasted in the internal option of Hazel. That sounds like there might be a problem with your Hazel.
Rob, a question if I may.

The current entries look like this.
## Wei/Scheduler[:](omnifocus:///task/kIIJ0CzGJa1)
- Afspraak Andries aanpassen @done(17:52)

I would like to have a little less info in the entry like:
- Afspraak Andries aanpassen @done(17:52)

I'm willing to give editing the script a try but is possible or does it need al the information to function at all?

Originally Posted by Guus View Post
I would like to have a little less info in the entry like:
- Afspraak Andries aanpassen @done(17:52)
You can certainly edit the output simply adjust the print statements in:
    if (prj!=$5) {prj=$5;
        if (prj!="") {print ("\n" prj_prfx prj "[:](omnifocus:///task/" $2 ")") >> "tmp_pretty.txt" }
        else {print ("\nInbox[:](omnifocus:///task/" $1 ")") >> "tmp_pretty.txt"} 
  if ($6!=prj) {print ("- " $6 " @done(" $4 ")") >> "tmp_pretty.txt"  }
  else {{print "- *Project completed* @done(" $4 ")"  >> "tmp_pretty.txt" }}
$6 contains the task and $4 contains the date.

You could reduce it right down to something like:

    print ("- " $6 " @done(" $4 ")") >> "tmp_pretty.txt" 
veel geluk !

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatic Exporting via Hazel varyags OmniGraffle General 0 2012-03-22 11:43 AM
OmniWeb Download + Hazel halbtuerke OmniWeb Feature Requests 10 2008-05-03 01:49 PM
Time logging Finlay Boo OmniFocus 1 for Mac 5 2008-03-12 12:02 PM
Logging into eBay Twice Kazammm OmniWeb Bug Reports 4 2008-03-04 12:19 PM
Suggestion: Logging! seebs OmniFocus 1 for Mac 0 2007-09-19 04:55 AM

All times are GMT -8. The time now is 08:01 PM.

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