PrefsFolder XObject

XObject

Detects standard location of Mac preferences files

The PrefsFolder XObject allows you to detect the name of the Preferences folder on the Macinstosh startup disk. This can be very handy when you need to store information in a standard location on every Macintosh. It's often used to store a small text file which indicates the actual installed location of a Director presentation on the hard drive.

The PrefsFolder XObject is free.

Note that Macromedia's free FileIO Xtra for Director 5 and later has a cross-platform global handler 'getOSDirectory' that serves much the same purpose as this older style XObject.

If you build installers with Stuffit InstallerMaker from Aladdin Systems, you can use the Preferences Plug-In for InstallerMaker, also from Dirigo Multimedia, to automatically create a custom preferences text file from the installer program itself. Your Director code running from a CD can then find the installed location of the software, using the PrefsFolder XObject. More information about the Preferences Plug-In is available from Dirigo via email to gpicher@maine.com. If you are interested in similar functionality for use with Developer VISE or other Mac installer products, please contact me at gpicher@maine.com.

Accessing the Preferences folder can also be particularly useful when designing CDs that automatically run when inserted (using Windows 95's AutoRun feature, and QuickTime 2.0 and later's AutoStart feature on the Macintosh). The application that starts automatically can determine whether to run an installer if no preferences file yet exists, or run the already-installed software on the hard drive in the location indicated by a preferences file in the Preferences folder.

There is no direct equivalent of the Preferences folder on Windows, so the PrefsFolder XObject only exists for the Macintosh. You can, however, use the WinDirs XObject, also from Dirigo Multimedia, and also free, to detect the Windows directory, where private .INI files can be stored. Same strategy, but a slightly different XObject implementation.

A demo movie is enclosed with the PrefsFolder XObject which demonstrates the use of the external. The demo movie is in Director 4 format, but can be opened and used without modification in Director 5 and later. The demo movie contains a script castmember with cut-n-paste Lingo handlers, to get you up and running immediately.

I'd appreciate a note from you if you pick up a copy of PrefsFolder here. I'll keep you informed of updates. Email me at gpicher@maine.com.

The .sit.hqx format is standard for Mac shareware distribution, and can be downloaded to either a Mac or a PC with Stuffit Expander for Mac or for Windows from Aladdin Systems. You should be able to download this Mac XObject even using a PC (decompressing the .hqx or .sit file on a Mac).


Small Dirigo logo

Glenn M. Picher: Dirigo Multimedia
Back to Glenn's home page