[comp.sys.mac.hypercard] Pathnames

jdevoto@Apple.COM (Jeanne A. E. DeVoto) (04/27/91)

In article <47966@ut-emx.uucp> ben@ut-emx.uucp (Ben Sloan) writes:
>I have a script that uses the Import Paint file command. I put the 
>chosen file name into a variable, say "filename", where it always
>is the full path, e.g. "hard disk:hypercard:myfolder:paintfile".
>
>The problem is that this filename is not the name of the window displaying
>the file. If the window goes to the background, I can't pull it back 
>by saying "show window filename" because the window has only the 
>name of the file without the path.

All you need to do is to get the stack name, given the full path: in
other words, you need to get all the text following the last ":" in
the pathname. The 2.0 Home stack script has a handy function that will
do this for you: lastHCItem delim,theText. Use it like this:

  put lastHCItem(":",myPathName) into myWindowName

There's a lot of handy stuff in the shipping Home stacks that's not
adequately documented....
-- 
========= jeanne a. e. devoto ========================================
 jdevoto@apple.com     |  You may not distribute this article under a
 jdevoto@well.sf.ca.us |  compilation copyright without my permission.
______________________________________________________________________
 Apple Computer and I are not authorized      |        CI$: 72411,165
 to speak for each other.                     |