[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trying to get Finder to Command-A (select all)



At  7:21 PM 6/15/94 +0000, MATTHEW CORNELL wrote:
 >Dear Folks:
 >
 >Here's some code (the function TEST) that wants to post the Command-A
 >event after switching to the Finder, with the hope of getting the
 >finder to Select All. The result, however, is MCL does a select all
 >then the Finder gets switched to.

Ack!! Nooooo!!!
No, really, you should be doing this with Appleevents, not by
messing with the key event queue. You're just *begging* for trouble.

Now, the only problem is that Finder/System 7.1 was frozen just before
the design for AppleScript was finalized, so the Finder doesn't
actually respond to Apple Events in the normal way. Your best bet
is to upgrade to the "scriptable" Finder, which is currently available
in a couple of ways:

  * as part of System 7 Pro (aka 7.1.1, on sale everywhere)
  * as part of Applescript 1.1 (also on sale everywhere)
  * as part of System 7.5 (beta release available to registered developers)

My choice would be the Applescript package, it's way cool.

It sounds like the rest of what you want here isn't even
really based on the Finder, but on scripting your logging app.
Getting the Applescript package would tell you more about
how to do this. Also, there's a decent book out called
"the Tao of Applescript". Check out Tom Bonura's
applescript-from-lisp on the contrib ftp site
(cambridge.apple.com:/pub/MCL2/contrib/applescript-from-lisp.hqx)

If worst comes to worst, you can get a utility like QuicKeys to
type menu commands for you, and send AppleEvents to it.