The birth of a new app

by Giles Turnbull

It started with a plea for help from a chap named Tim:




Hi,

I've been a PC user for more years than I care to admit to but have
recently bought a mac (10 days ago) and am already missing a very
important app I use in my work, rest and play. Namely, a text editor
that I can leave running in the background and have it automatically
grab whatever I copy to the clipboard (the PC app is NoteTabPro). I was wondering if anyone knows of a similar app for OS X. Thanks.


Members of the 43 Folders mailing list sprang into action with a list of helpful suggestions; NoteBook, DEVONthink, OmniOutliner, Notational Velocity, Clipboard Sharing, Quicksilver; many of them among the list of usual suspects when it comes to productivity and that mysterious nirvana known as getting things done.



All of them superb bits of software that do some clever and wonderful things; but none of them quite what Tim, the original poster, had been looking for. As he and others pointed out in follow-up messages, all these suggested apps required extra key presses or mouse clicks to get the contents of the clipboard copied to a file. What he wanted was something that did archived the data as soon as it was copied.



Sure, there are plenty of clipboard history apps out there, but none of them behave quite the way Tim wanted. Most concentrate on keeping a list of the last n copies, which is then available to the forgetful user. Tim's request specifically mentioned appending text to a file, and could be used in quite a different way. Example: consider Webstractor, the neat little app that watches your web browsing and keeps an editable copy of everything you see. A simple copy-and-keep app could provide a simpler, text-only version of the same service.



Enter Sam DeVore, full-time dad and part-time programmer. He saw the need for something new, and suspected he could create it very rapidly. He posted to the list, announcing his plan, and set to work.



Sam, from Tucson, used to teach math and science at middle school. Now he spends much of his time as a stay-at-home dad, but still likes to meddle with the occasional programming project "to keep my brain from going away,"
as he puts it. Sounds like an excellent idea.



Although most of Sam's coding projects lean towards education, since that's his professional background, Sam was confident that he could put together a simple clipboard monitoring application that would do what Tim had asked.



Sam started by sketching out what he needed to do as a flow chart. Good old pencil-and-paper, although he adds: "I'll probably translate it to an OmniGraffle document later."



"After that," he says, "I fired up REALBasic and started down the chart."



The original post to the list had asked for a text editor. Rather than write a new editor (there are, as we all know, plenty of decent editors for Mac), Sam thought about creating an application that could keep a constant watch on the system clipboard. When new data is copied to the clipboard, it automatically and immediately appends it to a text file.



REALbasic working environment
Sam's working environment in REALbasic



Here's Sam's summary of how work progressed:



"As I went along I tried to identify those actions that would be used in more then one place and made a class (object oriented dev being all the rage) out of it. This let me abstract the storage and the access to the information.



"This was all done with what has now become the debugger window as a display to let me know in the background that I was getting stuff out of the clipboard."



Debug mode
Clipboard Watcher's debug window



"At this point I was only working on the input side. I knew that appending to the text file was a no brainer, it was just a form of logging which all my apps have built-in anyway. The thing that made this app so easy was that it has no real interface, which for me is always the most time consuming aspect.



"The really funny part of this process so far is that I have spent the most time on the really ugly icons that the app has now, then on getting the web and email list infrastructure set up, and the least amount on the coding."



As far as next steps goes, Sam's plans are flexible. There's a wiki where users can contribute their own suggestions.



"I'll probably add the ability to get URLs from the major browsers and file paths from all the editors that I have (BBEdit, TextMate, MS Word, and so on). Then probably look at adding a statusItem for a Menu Bar icon.



"I think after those two things are done, I'll toss it into the wild and see what sticks."



Sam's pleased with the project.



"I really get a kick out of doing quick little apps; my Dock is full of little one-trick ponies that I have done; from AppleScriptStudio apps, to shell scripts wrapped in Platypus/REALbasic.



"This is what I love about my OS X box; there are so many great tools to build little things."



The end result is something that exactly matches Tim's request. Clipboard Watcher (the name is still up for discussion) keeps an eye on your clipboard and adds anything in it to a text file of your choice. You can adjust what other data is added alongside each clip, such as timestamp, name of source application, and so on.



From newbie request on a mailing list, to functioning release in one week. That's what anyone would call "getting things done".




Don't you just love it when a plan comes together?


16 Comments

c1sc0
2005-04-04 07:44:23
run this as shell script continuously after startup?
pbpaste >> /ClipBoard.txt
nerf
2005-04-04 10:30:59
What Tim is looking for . . . .
I wonder if he's looking for something like the old scrapbook app which acted like a mini-database for text and images for copy paste
blech
2005-04-04 11:20:39
The Finder "Show Clipboard" *should* be enough
.. but it's not. It doesn't update unless the copying app is the Finder itself, and if you do copy something in another app, you have to close the reopen the window to show it.


Somehow I can't quite believe that it was like that in Mac OS 9, but I don't have a box up to check right now.


Chalk another one up for the Finder X haters, I suppose.

sheilak
2005-04-04 11:51:00
Clipboard utility comparable to ClipMate
Contrary to the quip that "forgetful" people need to see earlier entries in their clipboard...


Some of us (such as web hosting tech support) have a great need to manage lots of clips for support responses and the like...


I have recently purchased an iMac G5 (2 months ago) but have yet to find a clipboard utility for Mac OS X comparable to ClipMate which was EXTREMELY helpful for me in my job.


The closest I was able to find was iClip which is in the list of clipboard utilities linked from this article. I will go over that list too, hoping to find something more suitable than the iClip that I am using now...


jdearr
2005-04-04 12:44:03
What Tim is looking for . . . .
I'm new at all this, but I do a lot of work grabbing from web sites and turning the clipboard into a word doc. I wrote a simple applescript called paste and save that creates a new doc (when Word is running) pastes the clipboard and asks me where and under what filename I want it saved. Is going to the script icon on the menu bar one step too many? Regardless, it has saved me tons of time and is very helpful. Happy to share it if asked.
Tim_b
2005-04-04 15:44:53
The original poster
As the person that started this whole thing off I have to say how surprised I was that something as simple as the way I wanted to work was so hard to find on the Mac. I've only recently started using a mac and found too many of the apps available want to give you amazingly sophisticated functions and processor machine-cycle using fancy interfaces (who's idea was it to have bloody floating tool palettes in photoshop so you can't see what app your using!), yet make simple things that people really need so difficult to find and/or operate. I would like to say a big thank you to Sam for putting so much time and effort into helping a Mac-newbie out. I actually contacted the authors of NoteTabPro and asked if they were going to convert their prog to OS X - unfortunately not; A great shame, the mac would be a much better place for it (IN-V-HO). Tim
podperson
2005-04-04 15:56:31
Seems like a bit of a hack...
Rather than periodically checking the clipboard (presumably several times per second), wouldn't a more elegant approach be to trap the system calls which set text values on the clipboard?
fud
2005-04-04 16:57:40
"AppendNote" service
There is a free service, AppendNote, from http://www.enigmarelle.com/appendnote.py that appends selected text to a file, along with the date and time, by pressing the keyboard shortcut Cmd-Shift-J. I have been using this for almost 2 years, and my "notes.txt" file is over 14,000 lines. I find this more useful then permanently saving everything that passes thru the clipboard. There are many times I wouldn't want to change the clipboard just to save a snippet of text.
qazwart
2005-04-04 21:55:00
Text Editor that Takes what is on the clipboard
Heck, I think I have exactly what this guy is looking for. It's called TextSoap.


When you open TextSoap, it automatically puts whatever you text you have cut into a document. Closing the document will put the changed text back onto the clipboard where you can paste it into another application.


I can leave TextSoap in the background, and switching to TextSoap will create a new document with the clipboard pasted text already in it.


Probably why no one mentioned TextSoap is because it isn't really meant to be a text editor. TextSoap was made to clean up text formating. TextSoap contains about 80 separate text cleaners that can clean up all sort of mangled text. TextSoap can rewrap text, smarten quotes, straighten quotes, fix MIME encoding, change End-of-line characters, remove HTML formating, etc.


However, TextSoap can read and write text documents, do spell checking, and find/replace text. It has some basic text formating capabilities (set font, paragraph styles, etc.). So, it can be used as a text editor.


The really nice thing about TextSoap is that it works inside existing Cocoa applications. I can select the text, right-click, and clean up the text without ever leaving the current application.


More information can be found at .

mparretti
2005-04-05 01:37:00
The original poster
I guess one of the reasons that such an app has not been developed for the Mac before is perhaps because there is at least one 'Mac way' of doing what you want to achieve. This is drag and drop. It has been a round for a long time on the Mac and works very well in and amongst most applications. Drag and dropping is not really more complicated or much more time consuming than copying (It's just an action after selecting text after all), in fact it's easier if you act on an image or a file rather than text, and with Expose it is even easier to drag and drop between applications. Windows drag and drop is much more unpredictable (although definitely getting better in my experience.)
gilest
2005-04-05 01:46:08
The original poster
Yeah, that's a perfectly good solution if you are a happy mouser. But some people go out of their way to avoid using the mouse or trackpad (I'm one of them), so hitting Command+C is a far more attractive option than reaching for the pointing device.
hejazzman
2005-04-05 09:08:36
The original poster
I don't think drag and drop works very well on OS X.


For example say I have Preview open on an image. If a drag another image from the Finder or the Desktop to the Preview
window, it won't open it.


This happens with a lot of apps. They won't load a filetype they understand that you "drop" on them. They insist of you going to "file -> open...".


Am I missing something? If not, come on Apple! It's not like it's something hard to enable.

PiZero
2005-04-05 12:09:50
The original poster
In your specific example. Preview is a viewer application not an editor, so you can't drag another image into one that's already there. You can, however, drag the image to the Preview Icon in the dock/finder/desktop and it will open it in preview.


I've never had a case where dropping a file on an application icon didn't open the file (assuming it could read it).
Josh_Bryant
2005-04-05 18:42:38
Text Clipping
I too would agree that the primary reason this has never been done before is simply OS X's drag and drop.


I constantly use the clipping service and simply drag text from Safari (or anywhere) to the desktop which creates a clipping file. I go through at least 10 clippings a day.


Sounds like a great app if that is the way you are used to working though!

Josh_Bryant
2005-04-05 18:44:56
Text Clipping
I too would agree that the primary reason this has never been done before is simply OS X's drag and drop.


I constantly use the clipping service and simply drag text from Safari (or anywhere) to the desktop which creates a clipping file. I go through at least 10 clippings a day.


Sounds like a great app if that is the way you are used to working though!

windu2k
2005-04-05 23:04:33
run this as shell script continuously after startup?
pbpaste simply causes the "Paste" command to be executed and it's contents sent to standard output (in this case appended to /ClipBoard.txt). It isn't a pipeline from the pasteboard. It sure would be nice if it was, however.