I knew it was too good to be true. I found that it works in the
background
and everything,
Er.. I never tried it on OS X, but I know it doesn't work in the
background on OS 9. Ah yes, I just tested it on X and it does work in
the background. Not sure about Win32. There are some oddities on Win32,
though.. I think you have to have a window open to use the clipboard...
it's in my notes, not sure if it has to be frontmost...
However, if there was a way to somehow just save the clipboard verbatim
and
restore it later, that would solve all the problems of appending styled
text!
AFAIK, there's no elegant way to do this in RB... Is there some sort of
toolbox call you could use to do this?
Yes.
Or your class?
Yes, that's what I said. I wrote it before I found out that you couldn't
use the clipboard in the background (in OS 9). Of course that
disappointed me a bit - but now it seems it has a use! You can download
it at http://homepage.mac.com/pyropostal/code/clipboard_save_restore.sit
Actually, it turns out I have code in there for Win32 also, but I can't
remember if it worked or not. I think it did. Well, you can try it.
The demo lets you test it out with save/restoring text, but it really
saves/restores any data on the clipboard, whether picture, sound,
whatever... so you can test it in conjunction with another app that uses
the clipboard for those things.
|