How To Call a Visual FoxPro Application Using AppleScript

Last reviewed: June 12, 1996
Article ID: Q152280
The information in this article applies to:
  • Microsoft Visual FoxPro for Macintosh, version 3.0b

SUMMARY

Since Visual FoxPro for Macintosh does not create stand-alone executables as FoxPro 2.6 did, AppleScript will not be able to directly call the executable with the TELL statement. This behavior occurs because the executable will require the use of one of the Visual FoxPro Support Library files to run. AppleScript will have to TELL the Visual FoxPro Support Library.

MORE INFORMATION

The sample AppleScript below will TELL the Visual FoxPro Support Library to open a Visual FoxPro executable named "MyProgram.exe" that is located in the MyApps folder on the Macintosh HD, activate it, and then have it display a Wait Window containing the text "Hello World!":

   tell application "VFP Support Library PPC"
      open "Macintosh HD:MyApps:MyProgram.Exe"
      activate
      Do Script "WAIT WINDOW 'Hello World!'"
   end tell

Note that the Visual FoxPro executable must have a READ EVENTS in it so it does not quit as soon as it is finished launching.

The main program of the MyProgram.Exe file should contain code similar to the following:

   \* kbon
        Do Mymenu.mpr
        READ EVENTS
   \* kboff

The Mymenu.mpr program has an option to CLEAR EVENTS to allow the executable to be exited. For more information on READ EVENTS and CLEAR EVENTS, see Microsoft Visual FoxPro Online Help.

Applescript is manufactured by Apple Inc., a vendor independent of Microsoft; we make no warranty, implied or otherwise, regarding this product's performance or reliability.


Additional reference words: 3.00b VFoxMac
KBCategory: kb3rdparty kbhowto
KBSubcategory: FxinteropDbase



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 12, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.