#Funny paths
4 messages in this thread
Here is the hierarchy of my C++ folders:
THINK C++
|
————————————-
| | |
C++ Projects Think Ref …other folders
TPM, xlators etc Proj x Proj y
(no projects) only project stuff
I also have the following aliases on my DeskTop
Proj x alias (of the Proj x Folder)
Proj x.~ (pie) alias ( of the project document)
When I launch TPM by double clicking on the project alias everything works fine
ExcepT that whenever I do an Open from the file menu or by Cmd-O I find myself
in the C++ folder instead of my project folder.
However if I launch TPM and then open the project things seems to work OK.
Anyone else notice this? Am I doing something wrong?
Peter
Peter,
You are doing nothing wrong. This is the way applications that accept Apple
Events work. The default directory will always be set to that of the
application.
Before Apple Events, you got your list of documents through the functions
CountAppFiles() and GetAppFiles(). GetAppFiles() set the global variables
CurDirStore and SFSaveDisk. These are the variables that tell the SFGetFile and
SFPutFile routines where to default to.
For the same kind of functionality to exist in an Apple Event aware app, the
programmer would have to set these vars every time they handled an 'odoc' or
'pdoc' event.
All of that said, there is a freeware extension that solves this problem. It
was written by Dave Heller, the co-author of AutoDoubler, and is available in
the Developer section of America Online. I would upload it here, but the "read
me" says that you must upload it in DiskDoubler SEA format and I threw away the
SEA.
jud spencer
jud:
>> global variables CurDirStore and SFSaveDisk.
Thanks for your explanation. However it raises further questions:
Why is it that launching the app and navigating to my project to open it seems
to save the currdir but launching from the project alias does not?
I would have thought it possible to determine the directory and save it since
the project is indeed opened hence the dir is available at that time no? Thus
it shouldn't be too difficult to save it?
Or am I all wet on this?
Peter
Peter,
When you open by double clicking the TPM, the SFGetFile comes up asking for
your project location. The two global variables are set as you navigate through
the directory hierarchy. They are always set to whatever directory you are
currently viewing. By launching via an alias, the SFGetFile never actually
enters the directory your alias' target is in. It is resolved internally.
You are correct in assuming that it is not too difficult to set these globals
during 'odoc' events. I have done this with the next release of my current
product.
jud