Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 21 in printed book and digital formats -- plus a one-year subscription (beginning with 22.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Issue 10.6 ('Retina')
Instant purchase and download via GumRoad!

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):

Download Icon 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.