>I would like to throw my hat in the ring and repeat the question: Is 
>there a way of launching other apps from within a Metacard 
>standalone. This would be great for running demos that are built 
>using Java or Director etc. from MC without having to rebuild them 
>in MetaCard.
>
>I have gone the other way...using the Open command to run a Metacard 
>standalone from Director.
>TIA,
>Blair

Have you tried using the "launch" command?  This allows you to launch 
an application, either on its own or with a document to be opened. 
Of course you'd need to know where Word was installed on the client 
machine, but this should be available as a registry entry (under 
Windows) or through AppleScript (under MacOS).

Here is the code I use to open the default Web browser on Mac/Win and 
display a given file (either as a local file, or a general URL):

on showWebPage webPage, isLocal
   if webPage is not empty then
     set cursor to watch
     set lockCursor to true

     -- find default browser:
     if "Mac" is in platform()  then
       put empty into theBrowser
     else
       -- special case - get path of Win internet Browser from 
registry (no Mac equiv.):
       put word 1 to -2 of \
 
queryRegistry("hkey_local_machine\software\classes\http\shell\open\command\") 
\
         into theBrowser
     end if

     if isLocal then
       if there is a file thePage then
         put webPage into thePage
       else
         set lockCursor to false
         answer "Can't find Web page '" & thePage & "'." with "Cancel"\
             titled "Unable to Go to Web Page"
         exit showWebPage
       end if
     else
       put webPage into thePage
     end if

     if "Win" is in gPlatform then
       -- use default Win Browser from registry:
       kill process theBrowser  -- close any currently running Win Browser
       wait 15 ticks
       set lockCursor to false
       launch thePage with theBrowser
     else
       -- MacOS - get Finder to select Mac Browser:
       if isLocal then
         put "file://" & thePage into localPage
         replace " " with "%20" in localPage
         set lockCursor to false
         send localPage to program "Finder" with "GURLGURL"
       else
         put "url:" & thePage into remotePage
         replace " " with "%20" in remotePage
         set lockCursor to false
         send remotePage to program "Finder" with "GURLGURL"
       end if
       replace " " with "%20" in localPage
       set lockCursor to false
       send localPage to program "Finder" with "GURLGURL"
     end if
   end if
end showWebPage

Note that you have to be careful about opening multiple copies of an 
application under Windows (Word in particular is a real pain in this 
respect!).  This is why my code above will abort any currently 
running copy of the Windows browser before launching a fresh copy to 
display the specified file. This is not really very friendly for the 
user, but is the lesser of two evils!

With a bit of fishing around and experimenting, you should be able to 
adapt the above to work with Word (you'll need to find the equivalent 
registry entry for Windows and AppleScript code for the Mac).

Using the "launch" command, you can open any application with/without 
a file, you just need to know how to locate the application.

Hope this helps.

Peter
-- 
--------------------------------------------------------
Peter Reid
Reid-IT Limited, Loughborough, Leics., UK
Tel: +44 (0)1509 268843 Fax: +44 (0)870 052 7576
E-mail: [EMAIL PROTECTED]
Web: http://www.reidit.co.uk

Archives: http://www.mail-archive.com/[email protected]/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to