Showing 3 posts tagged hack

A Hacked Bookmarklet For Workflowy Users

I recently wrote about my use of Workflowy in my, er, workflow (see Small pieces, even more loosely joined), and noted that the tool lacks a bookmarklet.

Knowing only a little about javascript I thought I would scout around and see if someone had crafted something that did some of what I wanted, which I described in my GigaOM Research post this way:

Imagine that I am reading an article by Richard Florida, and I want to save snippets of it in my Workflowy. If Workflowy had a bookmarklet — which is a strange omission — I would click on it, and it would do the following:

  1. Capture the URL of the page
  2. Capture the title of the article (if possible)
  3. Capture any selected text
  4. Place these in three appropriately labeled and editable fields
  5. Display some mechanism for indicating where the new item should be nested in my Workflowy
  6. Show an ‘Add’ button, which I’d press to add after selecting a location.

As a fallback, I’d like a bookmarklet that captures title, URL, and any selected text in a single text string, so I can cut and paste to Workflowy.

I’ve been using my Todoist bookmarklet, but it is less than optimal, since it places the URL first in the edit buffer and the page title second, in parens, for its own task creation purposes. 

The good news is that I found a bookmarklet that was almost what I wanted, and I hacked it to be workable.

The original bookmarklet is from 5typos.net, and created a three line text string with the page title, the URL, and any selected text from the page. Here’s it is, unescaped:


The problem is that the newlines (‘/n’ in the script) cause a problem: when I copy the text and paste to Workflowy it creates three outline items, when I really want one.

So I hacked the script, replacing the newlines with blanks:

javascript:(function(s){try{s=document.selection.createRange().text}catch(_){s=document.getSelection()}prompt(”,document.title+’ ‘+location+’ ‘+s)})() 

I re-escaped the javascript, and it works like a charm, although I still have to cut the clipped text (if any) from the original page and paste it as a note on the Workflowy item. This workaround is the result of the Workflowy import problem: there is no way to import an item with a note: the note is rendered as a second item if there is a newline separating them, and as part of the item’s header if there’s a blank instead. The Workflowy team would do us all a favor if they used a special sequence of characters to indicate that some text was intended to be the note of an item, for example, like ‘::’. I could rehack my bookmarklet, and all would be a step or two easier.

Related Posts Plugin for WordPress, Blogger...