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.
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
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.
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?
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.
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.
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...
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}
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.
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.
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.
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.
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...
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!
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\ One.app/Contents/MacOS/dayone /usr/local/bin/dayone
to put it on the path.
I'm getting this:
$ ln –s /Applications/Day\ One.app/Contents/MacOS/dayone /usr/local/bin/dayone
ln: /usr/local/bin/dayone: No such file or directory
What am I doing wrong?
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 '"!\" event not found'. I think the regex is fine. Too tired (and engrossed in Alcatraz) to figure it out.
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"
Brett, thanks for pointing me in the right direction. I add "escape spaces" checked in the Alfred extension options. That solved it.
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.
load more (2 remarks)