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.
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
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
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.:
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
%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...
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...
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/.
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:
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.
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.
Comments
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.
export
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
export
Should the launchbar script work in mountain lion, can't seem to get it going?
export
Here's the poorly commented script I call via Quicksilver:
export
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...
export
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.
export
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?
export
You can install Chronic on all Ruby installs with
rvm all gem install chronic, or try using/usr/bin/env rubyin the hashbang and see if it finds the correct version of Ruby in your environment.export
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.
export
Hi Andrew - did you find a solution for this in the end? Can't get the Launchbar action working here and using rvm.
export
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.
export
Thanks, Dave. It works well!
export
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...
export
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}
export
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.
export
same here no luck...
export
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.
export
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.
export
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.
export
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.
export
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.
export
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.
export
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.
export
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...
export
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...
export
Great, saves me the trouble of contacting them. Hope they fix it fast.
export
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!
export
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
to put it on the path.
export
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?
export
It's now a separate download, courtesy of App Store regulations. You can download it from the day one website.
export
Thanks Neil, I was trying to remember exactly how I installed the CLI!
export
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.
export
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:
export
Brett, thanks for pointing me in the right direction. I add "escape spaces" checked in the Alfred extension options. That solved it.
export
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.
export
Tom: You should also be able to do "#!/usr/bin/env ruby". I use env for perl & ruby in Lion.
export
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.
export