home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!olivea!apple!grobbins
- From: grobbins@Apple.COM (Grobbins)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: SFGetFile's directory after an Open Event
- Message-ID: <76105@apple.apple.COM>
- Date: 5 Jan 93 06:49:40 GMT
- References: <1993Jan4.190815.5881@ccu1.aukuni.ac.nz> <1993Jan4.205533.25405@kth.se>
- Organization: Apple Computer Inc., Cupertino, CA
- Lines: 49
-
- In article <1993Jan4.205533.25405@kth.se> d88-jwa@dront.nada.kth.se (Jon Wtte) writes:
- >In <1993Jan4.190815.5881@ccu1.aukuni.ac.nz> russells@ccu1.aukuni.ac.nz (Russell Street) writes:
- >>After an application receives an 'odoc' Apple Event to open a document
- >>should it arrange it so the next Standard File [Open] Dialog that is
- >>brought up by the user is the same directory that the 'odoc' document
- >>came from?
- >
- >If Apple thought that would be the right thing to do, they would
- >have done it themselves. Doing so requires changing lo-mem globals;
- >that's a dangerous habit you should break out of.
-
- Changing low-memory globals is not a particularly dangerous habit for
- system software, so that's not the reason the system isn't setting the
- Standard File directory. I'm not certain if the Blue Meanies made a
- calculated decision in System 7 on setting up Standard File or not, but
- the way the current system leaves Standard File pointing to useless
- places is clearly unpleasant.
-
- >Not to mention: if the app gets an odoc, the user most probably has
- >the folder open in the Finder, and going there and double-clicking
- >would be much easier than choosing "Open" in the File menu.
-
- But what about when the user makes a change to the open document
- and then chooses Save As...? Standard File continues to point to
- somewhere irrelevant (for most Apple event-aware apps, anyway.)
-
- Back when I was doing work for DTS, I revised the Standard File Tips
- Tech Note and included a recommendation that apps change the Std File
- globals (SFSaveDisk and CurDirStore) when they received an 'odoc' from
- the Finder. However, I could not build a consensus on when the app
- should and should not change the Std File directory (since scripting
- systems may also send 'odoc's) so I never released the revised version
- of the Tech Note.
-
- No one objected to developers storing values in those low-memory globals.
- Yeah, it's best to avoid doing such things, but those are well documented
- globals, there is no alternative method at present, and if you isolate
- access to such globals in your code, any future updates will be
- relatively painless.
-
- Except for those people who absolutely must control every aspect of
- their users' environment, my current recommendation is to leave
- Standard File alone. At least this way, when the system software
- folks get around to making Standard File point somewhere meaningful,
- your code won't be interfering.
-
- Grobbins grobbins@apple.com
-
- Usual disclaimers apply.
-