On 18/03/2003 at 12:01 PM, [EMAIL PROTECTED] wrote: Carl West <[EMAIL PROTECTED]> wrote:
> <[EMAIL PROTECTED]> > Subject: <lingo-l> Apple Menu/Clipboard Persistence? > > I've written a little piece that takes the text from the > clipboard, processes it and writes the result back to the > clipboard. > > In general, it works fine. I select and copy the text I want > processed, double-click my projector, it pops up, does the > thing and quits. When I paste again, I get the processed text. > > BUT! If I put the projector or an alias of it into the Apple > Menu Items folder and actually access it through the Apple > Menu... It works the first time. After that, regardless of the > text I've selected (and pasted again just to be sure it's in > the clipboard) I get that same text from the first time, > re-processed. If I run the projector directly again, it works. > If I run it from the Apple Menu again, I get the text from the > most recent directly-launched run, re-processed. > > I'm missing something here. How is it holding onto this > information? And more importantly, what can I do to stop it? > > MacOS 9.2.2, Dir 8.5, standard projector, minimal Xtras > included. Interesting issue. I've not seen exactly this, but I've observed - especially in more recent versions of OS9 - that 'old' clipboard text sometimes hangs around on a per-app basis. I suspect that CarbonLib has some hand in this - or rather NON carbonized apps may exhibit this behavior if CarbonLib is installed. I see it often in my mail client, Barebones' Mailsmith 1.1. (More recent versions are Carbonized). In particular, if I copy something to the clipboard that I wish to paste into an app which is not yet running, then launch the app, the clipboard often contains some very old clipping - sometimes even from the previous day!. I haven't isolated this completely yet. Another similar thing is when manipulating the clipboard with Applescript. There's a standard scripting addition 'set the clipboard' which ONLY works if you activate an application. I use a neat little utility called OSA Menu which allows me to run scripts from the menu bar at any time. Interestingly, all clipboard operations run from this menu fail. It's a known issue, and may be related in some way to what you are seeing. However, if I make an applescript application which manipulates the clipboard and run it from the Apple menu, it seems to work perfectly. (Maybe you should switch to Applescript, which is arguably more suitable for tweaking strings than launching a whole multimedia engine). Do you have Director MX? Try making a carbonized projector, run it under OS9 and see if this bug is still present. Sorry I can't be of more help. Brennan [To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
