问题
I love the windows 7 sticky note app and need to write a quick script to copy my notes to my iphone (easier than bringing a laptop to meetings). How can I extract my notes from the stick notes file (C:\Users\USER\AppData\Roaming\Microsoft\Sticky Notes\StickNotes.snt). The file stores undo entries, or other meta data, for each note, so I can't simply read n bytes from the start of a note.
Edit: Sample file - http://www.mediafire.com/download.php?qzgkj5gmdek
The encoding is difficult for me to decode. Text fragments aren't continuous, they're broken up by deleted strings (probably allowing for a per-sticky undo), and there aren't any clear delimiters. There is a forensic app that decodes the files. App description, taken from website...
http://www.simplecarver.com/exchange/articles/article-4.html
Structured Storage Extractor is a utility for reading and extracting information from the Structured storage format (ole container) files.
Apparently the data is stored in an OLE stream format. I tried using the PEAR OLE Library but it didn't read the stream properly :/.
回答1:
You can use 7-Zip for extracting the file, then copy the 0
file from each folder somewhere using the RTF file extension. Then you could use LibreOffice for converting the notes from RTF to PDF, for example. You could put this in a script, something along these lines:
7z x -yir!0 StickyNotes.snt
soffice --headless --convert-to pdf each_folder/each_0.rtf
回答2:
You will need to determine how the data is stored in the file, e.g. it may well use a simple format of breaking the file into sections, with each section having a header saying what the section is, and how long it is.
If Microsoft have not published this (a quick search on Google didn't turn up anything), then you will need to try and determine it your self by looking at some of the files. Also be aware that there is nothing to stop Microsoft changing the format with an update if they choose to do so.
回答3:
StickNotes data file is a Compound File (a filesystem within a file, an OLE storage container). Although the contents of a compound file are viewable through a compound file reader (http://www.coco.co.uk/developers/CFX.html), I can't find a port of the underlying CF/streams protocol.
Related question: How to extract the contents of an OLE container?
来源:https://stackoverflow.com/questions/1867903/decoding-windows-7-sticky-notes-file