Peter's Blog

Redefining the Impossible

Items filed under onenote


Latest candidate in my pursuit of the ideal Outliner is TreePad. This is the most appealing so far:

  • two-pane outliner: tree hierarchy on the left, node contents on the right. Simpler than Microsoft OneNote with it's confusing mix of tabs levels.
  • The node contents are rich text that can contain formatting, images, tables (unlike OneNote) etc. Node editor is virtually a word processor.
  • Nodes may contain hyperlinks to executables, web pages, other nodes in other treepad documents (unlike OneNote and better than leo's cloning which only works in the context of a single document). Hyperlinks go in article body, unlike Leo where they go in the tree node title, not a good place to put it in my opinion.
  • Tree nodes may have an icon associated with it. Leo loads it's selection of icons very slowly.
  • Not the fastest program I have used: the help file is a 5M treepad document and takes a good time to load up (1.5G Centrino).
  • Simple installation: one of it's features is that it can be installed on a USB flash key and carried around. I haven't found a licence agreement yet to tell me if it has to be licenced on each pc it is used on.
  • Robust encryption. Dare I trust it with my credit card numbers and passwords?
  • Can export in many formats including XML, OPML (which strips internal hyperlinks), html-ish files parsable by python. It is important to me that data can be extracted from any proprietary file format.
  • Documents can be exported as entire websites, complete with Javascript driven tree. Kinda tempting to examine the possibility of organising a website around with this, carryng it in pocket, publishing it, searching it, refactoring it, writing it to pdf... I find blog notes the best place to record things but web interface is not the best editor. Could type stuff in here and bulk move it to the blog.

It is commercial (£20 ish) but it is very polished (unlike Leo).


5 Comments

Uploading images to this blog can be kinda fiddly. Say I have an image in the windows clipboard (e.g. a screen clip from OneNote and I want it on the blog, I have to fire up a graphics program, paste it in, save it to a file, fire up filezilla, upload it, delete the image file.

This little script does all this for me. It asks for a file name, writes the image in the clipboard to the file, uploads it and deletes the image. Job Done.

The uploading is done using pscp, a version of scp from the putty camp. It uses my putty private key so I don't have to give a password for access to the server (I didn't use the cygwin version of ssh as it didn't like having 'c:\' in file names). The script uses the Python Imaging Library to do the grabbing and wxPython to ask for the file name.

   1  #
   2  # Upload image in clipboard to server
   3  #
   4  import wx
   5  import ImageGrab
   6  import Image
   7  import os
   8  import tempfile
   9  
  10  class MyApp(wx.App):
  11      def OnInit(self):
  12          oImage = ImageGrab.grabclipboard()
  13  
  14          if not isinstance( oImage, Image.Image):
  15              #
  16              # In no way is wxPython an easy to use library.
  17              #
  18              dlg = wx.MessageDialog( None, 'No image in clipboard', 'Error', wx.OK)
  19              dlg.ShowModal()
  20              dlg.Destroy()
  21              return True
  22  
  23          dlg = wx.TextEntryDialog( None, 'Enter a file name', 'Upload Clipboard', '')
  24          if dlg.ShowModal() != wx.ID_OK:
  25              dlg.Destroy()
  26              return True
  27  
  28          strName = dlg.GetValue()
  29          dlg.Destroy()
  30  
  31          strTempFile = tempfile.mktemp( strName)
  32          oImage.save( open( strTempFile, 'wb'))
  33  
  34          strCmd = 'pscp -q -i "c:\my documents\puttykey.ppk" %s me@myserver.com:www/images/%s' % (strTempFile, strName)
  35  
  36          os.system( strCmd)
  37  
  38          os.unlink( strTempFile)
  39  
  40          return True
  41  
  42  app = MyApp(0)
  43  app.MainLoop()

This is the result of alt-print screen and running this script:

images/grab.jpg

The script itself inside VIM

ToDo:

  • handle file names in clipboard
  • detect upload errors
  • allow resizing images

4 Comments

I was looking at the Microsoft Genuine Advantage Program as I wanted to try the Microsoft Antispyware beta. One of the goodies on offer was a 6 month trial version of Microsoft OneNote which is a program for taking notes and organising them. By the time a 6 month trial is finished I am either using something every day or I have not touched it for 5 months so I thought I would give it a try.

I am always interested in new ideas for organising notes. I've tried Wikis but web apps are a bit too slow and fiddly. I've tried blogging but I end up typing more than is necessary in order to be descriptive. I've tried outline editors but I never really get into the habit of using them. For notes I just want to bang in bare details, paste stuff in with a 3 word description.

OneNote gives you the following:

  • A simple place to type in arbitrary text. You click anywhere on a page and type away, giving a box with a note in it.
  • The notes are organised into a confusing multi-layer hierarchy of sections, folders and pages which map onto folders, subfolders and files in the physical file structure. Essentially there are multiple levels of tabs. However, once you have chosen a name for a section and folder, you don't really have to worry about giving your notes names or wonder where to save them.
  • Can drag and drop file or folder locations from explorer to a link in a note and then annotate them. Later you can click on the link to open them. Ditto for urls in FireFox. Cool way to build annotated bookmarks or add metadata to your file system.
  • Paste images into notes
  • A cool 'screen snippet' facility that lets you mark an area of screen and capture a bitmap to poke into your note. This has a bug on my multi-monitor setup whereby the cursor does not appear on one of the monitors.
  • Taskbar OneNote button for post-it functionality
  • If you are one of the select few that have a tablet PC then you can scribble on the pages with a crayonpen. You can use the mouse if you want to write like a three year old.
  • Spelling checker
  • Search through notes for keywords
  • Very basic automation interface that just about allows you to post new items. Here I use Python to poke in a new page:
       1  #
       2  # Poke an entry into OneNote
       3  #
       4  
       5  import win32com.client
       6  import pythoncom
       7  
       8  oOneNote = win32com.client.dynamic.Dispatch( 'OneNote.CSimpleImporter')
       9  
      10  strTemplate = """<?xml version="1.0"?>
      11  <Import xmlns="http://schemas.microsoft.com/office/onenote/2004/import">
      12      <EnsurePage path="Postings\\Posts.one"
      13          guid="{10DA1EEF-6415-4ae8-AF79-9E099F3800A8}"
      14          title="Odours" />
      15      <PlaceObjects pagePath="Postings\\Posts.one"
      16                 pageGuid="{10DA1EEF-6415-4ae8-AF79-9E099F3800A8}">
      17          <Object guid="%(ItemGuid)s">
      18              <Position x="10" y="10"/>
      19              <Outline>
      20                  <Html>
      21                      <Data>
      22                          <![CDATA[
      23                              <html><body><p>Sample text here.</p></body></html>
      24                            ]]>
      25                      </Data>
      26                  </Html>
      27              </Outline>
      28          </Object>
      29      </PlaceObjects>
      30  </Import>
      31  """ % { 'ItemGuid': str(pythoncom.CreateGuid()) }
      32  
      33  oOneNote.Import(strTemplate)
    
    Notes on this:
    • You need to know the Guid of pages to add stuff to them and there is no way to inspect the guids of existing objects so you have to create guids for you own objects and remember what you called them.
    • It won't create guids automatically, you have to do it.
    • You have to specify the position (x,y) of an object on a page and there is no way of knowing if it will collide with another object. The interface was added as an afterthought in SP1 and it shows.
  • Encrypt pages, save passwords etc

What it doesn't give you:

  • No way to link from one note to another, in a different section for example. Hypertextual linking would take it to a new dimension.
  • Can't drag and drop a note from one page to another, have to cut and paste.
  • Integrate OneNote with Outlook or Word unless you have Office 2003.
  • You can only export files in .mhtml format, a mime encoded html archive. Not total lockin but close. No way to extract data through automation interfaces.

I'm going to give it a try, to see if it will become indispensable to me. It seems very version 1 (which it is), there seems to be a lot they could have done with it. However, give Microsoft credit, this does not appear to be another 'me too' app designed to crush competitors but an actual attempt to create a new product.

Update:

This suddenly got more interesting:

  • You can drag and drop an email message from outlook to onenote and the email message is stored in a '.msg' file and a link to the message goes into your notes. Something I have always wanted, the ability to thread emails with notes. This turns out to be a standard thing in Outlook (Xp version anyway), you can drag and drop messages into the desktop.
  • You can scribble on notes with 'ink' and save it all to a .mht file which just about anyone can admire in internet explorer. Amaze your friends. This example may work in Explorer, FireFox may show the raw mime message, which is interesting in itself, eminently parseable.
  • The 'research' feature is set of onlike books. You can look up words like 'plaintively' which aren't covered by google define.

1 Comment