I recently wanted to setup a custom action in Quicksilver to do a simple task. Take any text I provide in the Object pane and write it to a file with a bit more around it.

After trying to write something in applescript and quickly giving up, I found an article that would allow me to write a custom action in Ruby.

Create a custom ruby script and put it into ~/Library/Application Support/Quicksilver/Actions (you may have to create the Actions directory)

This is what my script looks like. It’s ‘addTodo.rb’ I used this as an opportunity to try and pick up some ruby too so please forgive any newbie faux pas. This script creates a CSV and appends to it so I can open it in Excel or something similar.


#!/usr/bin/ruby
# writes to a file with a date

todo = ARGV[0]
now = Time.now
filename = "/Users/anoop/Documents/todos/todo.csv"

if !File.exists?(filename) then
filehandle = File.open(filename, "w")
filehandle.puts "Week Number, Time of Update, Update"
else
filehandle = File.open(filename, "a")
end

# format the date so that we have the week #, the current date and then the buffer
todobuff = now.strftime(“\”Week %U\”, \”%a %m/%d/%Y %H:%M:%S\”,”) + “\”" + todo + “\”"
filehandle.puts todobuff
filehandle.close

Save this file and restart Quicksilver (I had to restart it twice)

Activate Quicksilver, and type in

.your item for the todo list

In the action window, simply type search for ‘addTodo’ and you should see your newly added action. Execute and then confirm that the script was executed successfully.

Enjoy!

If you use something like Alfred or Quicksilver on your mac along with Flash Builder, then you might be annoyed by the key mappings in Flash Builder.

I only recently realized that Flash Builder’s Content Assist also uses the same ‘ctrl’ + ‘space’ key combination to make things easier when writing applications.

In order to utilize it, I modified my Quicksilver shortcut but just couldn’t get the hang of it. The muscle memory is harder to let go of I suppose.

Finally, with a bit of free time, I found out where the short cuts are configured and changed them. If you’re like me, then you know how painful Eclipse preference navigation can be.

To change the shortcuts, do the following

Preferences -> General -> Keys

Search for “Content Assist” and you’ll be able to easily modify that shortcut.

I changed mine to “option” + “space”

I bought a motobecane vent noir recently and have started training for a rather long trip. Here are some things that you may have noticed

  • You will feel the urge to flip off cabbies and will feel entitled to do so. Do it.

  • You feel like you’re riding against the wind. Both fucking ways.

  • You will pass up many mountain bike riders, runners, walkers, and children. Damn right. Fuck them for being slow. Enjoy it. It’s the little things that count.

  • Experienced riders will smoke your ass. Women, children, old guys with shit loaded on their bikes, everybody. They have “endurance”. Faith is your only friend. And perseverance.

  • You WILL fall off your bike if you bought clipless pedals and have never used them. Fuck what everyone says and keep at it. It’s all about practice. I’m still learning.

  • Your neck will hurt like hell. Take a look at the seat position and maybe even the stem on your bike. Adjust that if needed

If you want to see my workouts and routes, they’re all on mapmyfitness.com. [Link]


© 2007 wp | anoopdotnet | iKon Wordpress Theme by Windows Vista Administration | Powered by Wordpress