Smalltalk Magic: The Simplest Notes Browser That Could Possibly Work
From problem to source browser in 2 minutes (it took much longer to write this post about it)!
UPDATE: InspectIt (sorry, first version said “DoIt”):
'/path/to/home/Library/Mail/V2/Mailboxes/Notes.mbox/' asFileReference allChildren select: [ :e | e extension = 'emlx' ] thenCollect: [ :e | e readStream contents ]. |
Haha! Wow, Smalltalk never ceases to amaze me…
(It took me also quite some seconds to realize what you did… but that’s just me :-D)
@Sebastian No, that was my fault… I wrote “DoIt”, which shows no visual feedback. I meant “InspectIt”, which opens an inspector, which is the “Notes Browser”. Good catch! I’ve updated the post. Thanks.
Yes, Smalltalk as it is supposed to be. Thanks to the new FileSystem the code is compact. But instead of numerical indexes I’d like to see the file names…
Suggestion: With Glamour the specification of a GUI should not be much longer…
So would I
This wasn’t a tool I’d actually use in production, just a throw-away to help me during related development. What amazed me was that I was able, with Smalltalk, to inspect a model in a visually useful way in an incredibly short time, and it was even… [gasp]… fun!
Before Smalltalk, the effort in creating such a thing, just to throw it away, would outweigh its utility (even in Ruby, without an IDE to hijack as a model view).
It would be easy enough to create a dictionary mapping the filenames to the contents after the #select:. And yes, a proper GUI would be very straightforward with Spec or Glamour.