Copyright 1991, Chally Micro Solutions. This work may be distributed at no charge, provided that the fkey this documentation, and associated files are always distributed together, in whole and unchanged. Anyone wishing to distribute it along with any commercial software or include it in any public domain or shareware library may do so only with the express written consent of Chally Micro Solutions
Chally Micro Solutions makes no warranties, either express or implied regarding the enclosed software package, its effectiveness or usefulness. Chally Micro Solutions releases itself from liability for any damages resulting from the use or abuse of the PathKey, and such liability rests entirely on the user.
Problem: Provide a pathname for MPW or anything else that requires one, without going nuts trying to type it correctly from memory or using some other aid that was not designed to do the job.
Solution: PathKey. This FKEY presents a standard file dialog to find the file for which you wish to provide a pathname, then places the pathname on the clipboard.
• Introduction
I have often needed to provide files’ pathnames for MPW or other scripting languages. Until the need to provide pathnames for various scripts became particularly common, it never really occurred to me how dumb it is to try to type a file’s pathname from memory on the Macintosh. When I did attempt to do such a thing, I often failed, and found myself using the “Open File” option of MPW to allow me to “dig for” the file, just so I could interpret the pathname from its popup menu! It occurred to me that this is altogether too stupid behavior for a capable programmer, so after watching an associate exhibit that same behavior, I decided to spend a few hours writing PathKey.
• Installation
To install Pathkey, use ResEdit to put it in your system file like you would any other FKEY, and put “PathKey Info” in your system folder (not the extension folder or any other system 7 subfolder). If PathKey cannot find the file named “PathKey Info” it will complain at the bottom of the “SFGetFile” dialog. If you have Suitcase, I’m pretty sure you just need to point it to the file named “PathKey” instead of installing it in your system file (but still throw “PathKey Info” in your system folder).
• Usage
PathKey is particularly easy to use. If you know how to open a file and how to print a screendump, you know how to use PathKey. To activate PathKey, press command-shift-9 (You can change this to something other than 9 by changing the ID of the FKEY resource using ResEdit. Feel free to do this, but please distribute PathKey unmodified.)
Now that you have activated PathKey, you are presented a standard file dialog that should look similar to MPW’s open file dialog, except it has an “About…” button in the lower-right-hand corner. Select a file just as you would open it using MPW. If you cancel, the clipboard will remain unchanged, however, if you select a file, a copy of the file’s full pathname will be placed on the clipboard. Now all you need to do is select paste it into your document using any application’s “Edit” menu!
• Compatibility
PathKey seems to be pretty compatible—it works in the finder, and it works in MPW. THINK (Lightspeed) C seemed to work intermittently with it, but I think this is because it uses the clipboard improperly.
• Modification History
Version 1.0 — Inception, creation.
Future — Perhaps it would be useful to implement an MPW “Set Directory” style dialog to allow you to choose a directory’s pathname without needing to find a file in it. Perhaps an attempt to “automatically” stuff the pathname into the current TextEdit record of the frontmost window would be interesting (hmm…).
• About Support, Appreciation, and the Hacker Ethic.
I believe in the Hacker Ethic. As I have come to understand it, the hacker ethic indicates that programmers should freely provide each other utilities, programming methods, concepts, and most importantly: support and understanding. If we work together and help each other solve problems that apply to us all, we can significantly enhance our world.
Where does that come into this? Well, I’ve done my part. After using a variety of “neat” shareware and public domain utilities (I have actually paid for shareware that I use), I’ve felt compelled to offer a utility such as this freely to all for the common good.
What do you owe me? PathKey is Shareware. I’m not gonna send a guy named “Guido” with a violin case after you so that you send me money or stop using this DA, nor am I going to suggest an amount of money or even make you feel guilty for not sending any. If you don’t want to send me money, don’t get all hot and sweaty worrying about it. If you do, then go ahead and send me what you think it’s worth (no coins, fruit, or vegetables please).
Okay, so what am I getting at? Just this: if my work has benefited you, do something sporting about it: send me some money, comments, bug reports, pats on the back, etc. Better yet, write something useful yourself!
• Now that you’re filled in
I really would like to hear from you (even hate-mail), especially the bug reports. You can send me your comments, suggestions, money, etc. at any of the following:
Chally Micro Solutions
P.O. Box 2295
Covina, CA 91722
chally@aol.com, chally@earthlink.net
http://home.earthlink.net/~chally
The Macintosh world is something really special, and I’m happy to be a part of it. Thanks to all of you who have “done your part”.