Using Scripts with Other Windows Applications
|A ChemFinder (CAL) script can
communicate with other Windows applications using either of two
Using EXEC is straightforward, but limited. You can start all Windows applications by this command. Most can be passed a filename on the command line, such that the specified file is opened (or printed) on startup. A few applications can accept more detailed instructions. Consult the application's manual for information about how it can be operated using the command line.
If you have Visual Basic or similar programming language, you can extend the power of EXEC. You can write an application using the advanced features of Visual Basic, and then call the application from within ChemFinder using the EXEC command.
Using DDE is more complicated. You can operate most Microsoft Office components and many other programs to varying extents with DDE. For example, practically every command on the Excel menu can be executed by DDE. The syntax is rather difficult, but can usually be worked out by experimenting and consulting online help. An example is given below.
DDE is the most direct way of using Excel to view data from ChemFinder.
To use Excel to view ChemFinder data:
This procedure takes data one way, from ChemFinder to Excel.
The following script starts Excel:
If the Excel program is on your search path, you can eliminate the complete pathname and just give the executable name ("exec excel.exe"); if not, you may need to modify this script to indicate where EXCEL.EXE is located on your system.
The following script transfers the current hit list from ChemFinder to Excel:
The first line writes out the current ChemFinder hit list as a temporary delimited ASCII file. By default, all fields that appear in boxes on the current form--except structure, but including formula and molecular weight--are written. The second line instructs Excel to open the file. Excel can automatically recognize the file format as tab-delimited. The third line instructs Excel to auto-size column widths 1-4 to fit their contents.
Note: For Excel to read the file correctly, the ASCII File Export option on the Preferences dialog box General tab must be set to Tab delimited.
For more information, see Program Execution commands.
©2005 CambridgeSoft Corporation. All Rights Reserved. Privacy Statement
Tel 800 315-7300 / 617 588-9300 Fax 617 588-9390 Email firstname.lastname@example.org
CambridgeSoft Corporation, 100 CambridgePark Drive, Cambridge, MA 02140 USA