Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Opening folders in the Finder

0 views
Skip to first unread message

Jason Booth

unread,
Nov 27, 1996, 3:00:00 AM11/27/96
to

Given a reference to a directory, how can I get the Finder to open the
folder so it shows up on the desktop? I'm currently working in C, and any
help would be much appreciated.

Thanks,
Jason

David Gillies

unread,
Nov 29, 1996, 3:00:00 AM11/29/96
to
Send the Finder a Select event followed by an Open event. Details of
how to do this can be found in IM: Interapp Comms.
--
______________________________________________________________________
David A. G. Gillies (dagg...@vader.brad.ac.uk)
University of Bradford, Bradford, West Yorkshire, England
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

Daniel Morrow

unread,
Nov 30, 1996, 3:00:00 AM11/30/96
to

In article <jbooth-2711...@idd10.idd.com.blacksburg.va.us>,
jbo...@vt.edu (Jason Booth) wrote:

>Given a reference to a directory, how can I get the Finder to open the
>folder so it shows up on the desktop? I'm currently working in C, and any
>help would be much appreciated.
>

>Thanks,
>Jason

Well, you should find all that you need on the Developer CDs (Tool Chest).

Check out the Sample Code section, look under AppleEvents, and especially,
Finder Apple Events (of course).

You need an FSSpec to the directory.

Also, there are two ways to do this (both with AppleEvents)

If your finder is OSL compliant, then all you need to do is send it an
'odoc' event (part of the required suite) with the FSSpec of the folder as
your direct-object parameter. (The OSL compliance of Finder can be checked
with a Gestalt call).

However, if your Finder isn't OSL compliant (older Finders, pre System 7
Pro) then your Apple Event is much more complicated (but fully described
on the Dev CDs). For some reason, when Apple introduced Apple Events with
system 7, they didn't think it was important for Finder to use the "Core"
suite. Why not, is a great mystery really, but that is why there are two
methods.

Anyway, it's all there on the developer CDs (and may be on the Web sites,
I don't know).

Anyway, best of luck.

-Dan.

0 new messages