Applescript Tutorial 7
In an earlier tutorial I showed how it was possible to create a substructure searchable chemical database using FileMaker and OpenBabel. In the subsequent tutorial I showed one way to render the chemical structures using ChemDraw. Judging by the number of downloads of the file a number of people have been looking at it. As you will have noticed embeding the structure into a container field for each record results in a much longer file size. In this case a 650 record database increases from approx 300K to 55MB, so for large databases this increase in size could be a major headache. One option is to have a global container field that you can insert the structure into as needed, and it is very easy to modify the existing scripts to do this.
However in this tutorial I thought it might be interesting to exploit one of the new features in FileMaker, the ability to add a "webview" to a record to display an html page into which is embeded a java applet or plugin that can be used to render the chemical structure. (This has only been tested with FileMaker 9). So whilst this is in the Applescripts tutorial section this particular tutorial actually only uses the FileMaker scripting language.
The database used in the previous tutorials can be down loaded here, it includes the structure field but I would leave it in place for the time being.
First we need a couple of fields that we can use to generate the HTML for the web page, we need to add the three global fields highlighted below.
chemdraw_html_header field paste the following text:-
<html><h e a d >