Topic: https://brettterpstra.com/2012/01/16/logging-with-day-one-geek-style/
hide preview

What's next? verify your email address for reply notifications!

Eldon 12y, 89d ago

I have been surfing online more than three hours as of late, yet I by no means discovered any attention-grabbing article
similar to yours. It is beautiful worth sufficient for me.
In my view, stipulation all website owners and bloggers ended excellent content material as
you did, the internet will likely be a lot more useful than
yet sooner than. "I imagine that possibly stipulation women and children were in accuse we would get somewhere." by James Grover Thurber.

hide preview

What's next? verify your email address for reply notifications!

latest 12y, 93d ago

Great blog here! Additionally your web site
loads up fast! What host are you the use of?
Can I am getting your associate link on your host? I wish my site loaded up as quickly as yours lol

hide preview

What's next? verify your email address for reply notifications!

Rob Workman 12y, 142d ago

Should the launchbar script work in mountain lion, can't seem to get it going?

hide preview

What's next? verify your email address for reply notifications!

hce_ 12y, 243d ago

Here's the poorly commented script I call via Quicksilver:

 using terms from application "Quicksilver"
on process text message
do shell script "/Users/$home/Dropbox/dayone.rb \"" & message & "\""
my growlRegister()
my growlNotify("I will remember.", message)
end process text
end using terms from

-- Notify using Growl
-- Example: growlNotify("This is an Alert","This is a test of the Growl Alert System")
using terms from application "Growl"
-- Register Growl
on growlRegister()
tell application "Growl"
register as application "DayOne" all notifications {"Alert"} default notifications {"Alert"} icon of application "Day One.app"
end tell
end growlRegister
on growlNotify(grrTitle, grrDescription)
tell application "Growl"
notify with name "Alert" title grrTitle description grrDescription application name "DayOne"
end tell
end growlNotify
end using terms from
hide preview

What's next? verify your email address for reply notifications!

James Sulak 12y, 330d ago

For the heck of it, I ported the script to Tcl. This has the advantage of not requiring any external dependencies, and avoiding some of the RVM problems when using with LaunchBar, etc.:

https://gist.github.com/247...

hide preview

What's next? verify your email address for reply notifications!

Makzan 13y, 17d ago

Thanks for the code. In my version, I prefer to use the branch name.

https://gist.github.com/196...

And here is how my dayone log message looks like:
SnakeAndBall @dev_swipe_ctrl : Added control determine to show/hide snake up/right/down/left buttons; Also load alternative level only when control is swipe.

hide preview

What's next? verify your email address for reply notifications!

Andrew Broman 13y, 57d ago

I'm having trouble getting the LaunchBar Action working with rvm installed. There's apparently a problem calling rvm's default ruby from AppleScript. Instead, it calls the system ruby, which doesn't have the Chronic gem.

As a workaround, I replaced "do shell script" with 'tell application "Terminal" to do script' -- This unfortunately calls up Terminal.

Does anyone know a better solution?

remark link
hide preview

What's next? verify your email address for reply notifications!

Brett 13y, 57d ago

You can install Chronic on all Ruby installs with rvm all gem install chronic, or try using /usr/bin/env ruby in the hashbang and see if it finds the correct version of Ruby in your environment.

remark link parent
hide preview

What's next? verify your email address for reply notifications!

Andrew Broman 13y, 56d ago

Thanks, Brett. Unfortunately, even with the "/usr/bin/env ruby" hashbang, it still doesn't find the rvm ruby, instead using the Ruby.framework version. I think this has something to do with how rvm sets up the environment.

rvm's way of changing the environment also makes it difficult to install gems for that system ruby installation.

I've seen this problem discussed around the web, but I haven't seen a solution anywhere.

remark link parent
hide preview

What's next? verify your email address for reply notifications!

Matt 12y, 215d ago

Hi Andrew - did you find a solution for this in the end? Can't get the Launchbar action working here and using rvm.

hide preview

What's next? verify your email address for reply notifications!

Dave 13y, 57d ago

There's an all-applescript version I posted up there (linked on ObjectiveDevelopment's forums) which doesn't require any extra software installing. It depends on how important being able to specify dates and flag entries is to you.

remark link parent
hide preview

What's next? verify your email address for reply notifications!

Andrew Broman 13y, 56d ago

Thanks, Dave. It works well!

hide preview

What's next? verify your email address for reply notifications!

Thomas 13y, 61d ago

For those like me that wanted this to work with Alfred, MacStories has the scoop. You can see the script on that site at: http://www.macstories.net/t...

remark link
hide preview

What's next? verify your email address for reply notifications!

Robert 13y, 30d ago

The MacStories tip works just fine, but it is too complex. Just let Alfred directly run the ruby script as a terminal extension with the plain vanilla command

/Users//scripts/logtodayone.rb {query}

hide preview

What's next? verify your email address for reply notifications!

Vlahn 13y, 61d ago

I followed this post here from the Macstories article about using this script to post from Alfred - however I can't for the life of me get it to work. CLI symlink is in place, Chronic is installed, Ruby is installed in the correct place, the script is executable.. no luck.

remark link parent
hide preview

What's next? verify your email address for reply notifications!

james 13y, 58d ago

same here no luck...

remark link parent
hide preview

What's next? verify your email address for reply notifications!

james 13y, 58d ago

It's a problem with my dayone, if I type dayone into terminal I get a permissions error. Even though permissions were even placed at 777 - if someone knows what's wrong please let me/us know.

remark link parent

load more (1 remarks)
hide preview

What's next? verify your email address for reply notifications!

james 13y, 58d ago

Fixed my problem by archiving the 'dayone' CL file then moving that file into the /usr/local/bin/ - no symlink. works now. Two copies of the file on my system but at least it works.

hide preview

What's next? verify your email address for reply notifications!

Dave 13y, 62d ago

Hi Brett,

I did the same thing with Launchbar last year. I posted the Applescript to handle this on the Objective Development Forums. It depends on the DayOne command line app being copied out to somewhere in your path (or hardcoding in the script) but doesn't rely on ruby or any externals. Also, it doesn't bother with funky tagging.

hide preview

What's next? verify your email address for reply notifications!

keizo 13y, 62d ago

I couldn't work with LounchBar. Maybe I missed a place logtodayone.rb file. Could you tell me where logtodayone.rb file put in? I put it in Scripts folder which I created.

hide preview

What's next? verify your email address for reply notifications!

Mark 13y, 63d ago

Thanks Brett. Got it working from LaunchBar which is great. One minor annoyance (since I'm not a unix/ruby geek) is that the time being grabbed in the ruby script when no time is specified is off by 5 hours.

remark link
hide preview

What's next? verify your email address for reply notifications!

Brett 13y, 63d ago

That's odd. It comes out right for me, but it could be a time zone offset or defaulting to UTC. You might have to use .local to get it right... I'll play with some code later and see if I can figure that one out.

remark link parent
hide preview

What's next? verify your email address for reply notifications!

Mark 13y, 63d ago

So, here's what I've tracked down. I put together the following simple ruby script:

!/usr/bin/ruby

d = Time.now

date = d.strftime("%m/%d/%Y %l:%M%p")

puts d
puts date

%x{echo "just some text" | /usr/local/bin/dayone -d="#{date}" new}

and run it from terminal. It works fine with "just some text" showing up in Day One with the local time affixed. Thus, I don't think the issue is in the logtodayone.rb script.

But, if I enter a message using LaunchBar and the "Log to Day One.scpt" calling logtodayone.rb, the time for the entry shows up with the UTC offset applied.

hide preview

What's next? verify your email address for reply notifications!

Ronald 13y, 63d ago

I'm wondering how you search for your @tags in Day One. I've also always used those to tag my files, but in Day One searching for them somehow doesn't seem to work properly...

remark link
hide preview

What's next? verify your email address for reply notifications!

Brett 13y, 63d ago

Yeah, the more I play with it the more I realize it seems to ignore or misinterpret any leading punctuation. I'm in touch with the devs now, so hopefully I'll convince them to refine that part of the search...

remark link parent
hide preview

What's next? verify your email address for reply notifications!

Ronald 13y, 63d ago

Great, saves me the trouble of contacting them. Hope they fix it fast.

hide preview

What's next? verify your email address for reply notifications!

BooneJS 13y, 63d ago

Excellent idea, Brett. I'll end up buying LaunchBar yet; the reasons to own it keep piling up. Until I got Day One, I'd been using OhLife (after seeing it linked on http://minimalmac.com) for a while. Your post offered a tip that the dayone command-line tool was going to make it easy to import my OhLife history. I've posted the write-up on my tumblr if anyone's interested in taking a look. Thanks again!

hide preview

What's next? verify your email address for reply notifications!

Neil 13y, 63d ago

For people who may be confused like I was, the command line program is in the app bundle. Full details are at the bottom of the FAQ: http://dayoneapp.com/faq/.

You can try


ln -s /Applications/Day&#092 One.app/Contents/MacOS/dayone /usr/local/bin/dayone


to put it on the path.

remark link
hide preview

What's next? verify your email address for reply notifications!

Jay 12y, 166d ago

I'm getting this:

$ ln –s /Applications/Day&#092 One.app/Contents/MacOS/dayone /usr/local/bin/dayone

ln: /usr/local/bin/dayone: No such file or directory

What am I doing wrong?

remark link parent
hide preview

What's next? verify your email address for reply notifications!

Dave 12y, 166d ago

It's now a separate download, courtesy of App Store regulations. You can download it from the day one website.

hide preview

What's next? verify your email address for reply notifications!

Brett 13y, 63d ago

Thanks Neil, I was trying to remember exactly how I installed the CLI!

hide preview

What's next? verify your email address for reply notifications!

ron 13y, 63d ago

Love the script. I was using the CLI via Alfred, but this makes it super easy as an extension.

I can't get the Starred entry to function though. Script returns an error that '"!&#092" event not found'. I think the regex is fine. Too tired (and engrossed in Alcatraz) to figure it out.

remark link
hide preview

What's next? verify your email address for reply notifications!

Brett 13y, 63d ago

Sounds like the string isn't being quoted properly. Are you triggering from the command line or via the AppleScript? If you're on the command line, be sure to put quotes around the argument so that the bang isn't interpreted as a bash command:

 logtodayone.rb "! This is a starred entry"
remark link parent
hide preview

What's next? verify your email address for reply notifications!

ron 13y, 63d ago

Brett, thanks for pointing me in the right direction. I add "escape spaces" checked in the Alfred extension options. That solved it.

remark link parent
hide preview

What's next? verify your email address for reply notifications!

Thomas 13y, 62d ago

Ron:

How did you get it to work with Alfred? Did you just copy Brett's script into a Script Extension? I have Silent and Action options set, and "Required Parameter" but the script does nothing.

remark link parent

load more (2 remarks)
hide preview

What's next? verify your email address for reply notifications!

BooneJS 13y, 61d ago

Tom: You should also be able to do "#!/usr/bin/env ruby". I use env for perl & ruby in Lion.

hide preview

What's next? verify your email address for reply notifications!

tmarkiewicz 13y, 61d ago

Thomas, I was having the same issue so I tested it in the AppleScript editor. It turns out my version of Ruby is in a different location than Brett's. I changed the shebang in his script to #!/usr/local/bin/ruby and it now works fine.

Type 'which ruby' in your Terminal to see what you should add there.

hide preview

What's next? verify your email address for reply notifications!