Using AppleScript to Programmatically Convert PICT to BMPID: Q109483 2.50b 3.00b MACINTOSH
The information in this article applies to:
SUMMARYBecause the Pict To Bmp application that comes with FoxPro for Macintosh is a "scriptable" application, you can instruct it to programmatically convert a file of type "PICT" to a file of type "BMP" using AppleScript. See below for instructions and a sample script.
MORE INFORMATIONThe following script can be called from within FoxPro for Macintosh or any other application that can communicate with the AppleScript extension. The script can be keyed into the AppleScript Script Editor supplied with the AppleScript extension. This script requires that Scripting Additions be installed in the Extensions subfolder of the System Folder. The "choose file" Scripting additions is utilized. These additions are supplied with the AppleScript extension and placed in the Extensions folder by the Installer program. Please note that due to the limitations of the character set used to display and print this Microsoft Knowledge Base article, the line- continuation character created by pressing OPTION+RETURN on the Macintosh has been replaced by a semicolon (the FoxPro line-continuation character). When you are typing the script in the AppleScript Script Editor, replace any line that ends with a semicolon with the appropriate line-continuation character. To create the script: 1. Start the AppleScript Script Editor. 2. In the Script Editor edit region where the cursor is initially blinking, 3. Save the script. If the script will not save in its compiled format,
4. To run the script from the FoxPro for Macintosh Command window, issue
The first time the script is run, a dialog box may appear requesting the
location of the "Pict to Bmp" application. It is located in the
FoxPro:Goodies:Misc folder. In Visual FoxPro for Macintosh, the application
is located in the VFP:Tools:Tools:PictToBmp folder. To avoid this message,
specify the full path to the application in the Convert handler of the
script. For example, use the following command:
If the user chooses to cancel the script at any time during the execution
of the script, the following FoxPro error message will be displayed:
To avoid the display of this message in the context of a FoxPro program or
application, use an ON ERROR handling routine to trap for error number
1917.
For more information about creating scripts with AppleScript, see the "AppleScript Language Guide" or contact the Apple Programmer's and Developer's Association (APDA). Additional reference words: vFoxMac 3.00b FoxMac 2.50b KBCategory: KBSubcategory:
|
Last Reviewed: May 21, 1998 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |