[comp.sys.mac.hypercard] Hypercard access to external applications?

annie@cs.swarthmore.edu (Annie Fetter) (02/02/89)

kim@wayne.UUCP recently posted a question on comp.sys.mac about how Hypercard
accesses external applications.  There is a brief comment in Danny Goodman's
Hypercard Handbook, but not much else (as noted by kim).  Here's what I know
about it.

The following button script from my home card is an example:

on mouseUp
   global machine

   StdFile(machine & ":Applications:RGS 4.0")
   if optionKey is down then
      set cursor to 4
      open "Ready, Set, Go! 4.0"
   else
      put fileName("RSGK") into docFile
      if docFile is empty then exit mouseUp
      set cursor to 4
      open docFile with "Ready, Set, Go! 4.0"
   end if
end mouseUp

This button takes me directly to RSG if the option key is down, or allows me to
open RSG documents in the folder ":Applications:RSG 4.0".

StdFile is an XCMD (?) that tells Hypercard where to look for a file or
application. In this case, RSG lives on my hard disk ("machine", or just put
the name of your source) in a folder called Applications in a folder called 
RSG 4.0. 

fileName is an XFCN which will give you the standard Mac file dialog box,
suspending action in the Hypercard handler. You simply pick your file, and
fileName will put the name of the file and its complete pathname into docFile.
The "RSGK" tells Hypercard what kind of resource it should give you the option 
to open. "RSGK" is the kind of file created by Ready, Set, Go!. Another example,"WDBN" is the kind created by MS Word. You can find out this type by going into
ResEdit, picking a file created by the application you want, and doing "Get
Info." This will tell you the resource type. You can also get this using 
DiskFit.

Hope this helps!

C
C
C
Std


-- 
       Annie Fetter           |      annie@cs.swarthmore.edu    |
VGP-Department of Mathematics |      fetter@swarthmr.bitnet     |
    Swarthmore College        |  ...!rutgers!bpa!swatsun!annie  |
   Swarthmore, PA 19081       |         (215) 328-8225          |