Article Preview
Buy Now
COLUMN
Clipboard Keeper
Keeping track of your clipboard history
Issue: 10.6 (September/October 2012)
Author: Marc Zeedar
Author Bio: Marc taught himself programming in high school when he bought his first computer but had no money for software. He's had fun learning ever since.
Article Description: No description available.
Article Length (in bytes): 12,840
Starting Page Number: 69
Article Number: 10609
Resource File(s):
project10609.zip Updated: 2012-09-04 14:23:05
Related Web Link(s):
http://tidbits.com/pipermail/tidbits-talk/2012-August/009754.html
Excerpt of article text...
Recently there was a post on the Tidbits mailing list (http://tidbits.com/pipermail/tidbits-talk/2012-August/009754.html) looking for a software program that would keep a log of all clipboard contents. This sounded intriguing to me, both because of its usefulness (as a writer, it might be handy to have a clipboard log) and because it sounded like a simple yet just challenging enough program to write in Real Studio.
By simple I meant that in concept the application seemed easy—just watch for any changes in the clipboard contents and then append the most recent clipboard to a file. But in practice it would be challenging—how do you monitor the clipboard status from within a Real Studio application?
My first thought was to write this as a faceless console application. It seemed logical to just have this running in the background saving copies of all clipboard changes. In fact, that's the way I initially wrote it. But there are disadvantages to that approach, including the fact that there's no way to quit the app, change any settings, or interact with it in any way. I had thought that a GUI app might use more memory or resources, but that proved to not be the case. In the end, I ended up doing this as a GUI app, though one with a minimal user interface.
The Plan
Appending the current clipboard contents to a file seemed very simple, so the first problem I focused on was how to detect if the clipboard had changed. I toyed with the idea of trying to assess if Command-C had been pressed, but I ditched that because it wouldn't work if the user chose "Copy" from the Edit menu (or any other way of putting something on the clipboard).
...End of Excerpt. Please purchase the magazine to read the full article.