[tomboy-list] Export All Notes to HTML
David H. Vree
david.h.vree at gmail.com
Mon Dec 8 12:16:25 PST 2008
I would like to export all my notes to HTML, but the current user
interface only lets me do this one at a time. With over 300 notes, I
was hoping to avoid that.
I found a relevant post from a thread in April, 2008 that included the a
python script that creates a master note called "Note Index" which
references all the other notes. Presumably I could then export this
single master note and all the other notes would be exported as well as
linked notes are dragged along in the export process.
However, the script doesn't work. The master note is created, but the
body text is not set, but I do not know why (I am totally unfamiliar
with python). Any help is appreciated. Here is the script:
# This script creates a tomboy note containing link to each other note
# so one can easily export all the notes to an HTML file
note_title = "Note Index"
# Get the D-Bus session bus
bus = dbus.SessionBus()
# Access the Tomboy D-Bus object
obj = bus.get_object("org.gnome.Tomboy","/org/gnome/Tomboy/RemoteControl")
# Access the Tomboy remote control interface
tomboy = dbus.Interface(obj, "org.gnome.Tomboy.RemoteControl")
notes_links = ""
for note in tomboy.ListAllNotes():
notes_links += tomboy.GetNoteTitle(note) + " \n"
uri = tomboy.FindNote(note_title)
if uri == "":
uri = tomboy.CreateNamedNote(note_title)
tomboy.SetNoteContents(uri, note_title + "\n\n" + notes_links)
More information about the Tomboy-list