Open local files in Google Docs by double-clicking

I’ve started using Google Docs a lot recently, but one thing annoyed me: I wanted to have documents open in Google Docs just by double-clicking them in Finder.

The APIs are pretty good, so I’m surprised nobody has written a native app to do this. While I don’t have time to write a native app, I was able to whip up something thanks to googlecl and Apple’s Automator.

Opening local files in Google Docs by double-clicking (in 3 easy steps)

The following solution will allow you to open documents in Google Docs by double-clicking them. The document will be uploaded and opened. If the document has already been uploaded (matched by filename), it will just be opened.

  1. Install googlecl, the command-line interface for Google APIs. This is easy with on Mac OS X with Macports:

    sudo port install googlecl

    Don’t forget to authorise your Google Account with the tool. You can do this once from Terminal by just doing:

    google docs list

    (Then follow the instructions)

  2. Download the shell script.

  3. Create an application, and associate files to using Apple’s Automator.

    Set up the actions as per the screenshot here, and paste in the contents of the shell script:


    Go to File->Save As… and save it somewhere as an app.

    You can now open documents with this application. Simple right-click on a document, and go to Open with -> Other. Browse to find your newly-created application.

    If you want to open all documents like this, click the “Change All” button.

And that’s it!

It works! Yay! Bear in mind I slapped this together in the last hour. I might make it slightly more elegant if I get the time (or you can).

Follow me on Twitter!