Macs in Chemistry

Insanely Great Science

Export as mol file script updated

 

I’ve added a minor update to the Export as mol file script.

One of the issues with the original script that the mol file contains in its first line the incorrect title of the file (it appears to be the name of the document template).

When you just launched your ChemDraw application, or created a new document, the title would be “Untitled **”, such as "Untitled ACS Document 1996-1". When you save it as Mol file, its header block will inherit the current document title "Untitled ACS Document 1996-2”.

Untitled ACS Document 1996-2
ChemDraw12201318592D

14 16  0  0  0  0  0  0  0  0999 V2000

It would be better to have the molfile title the same as the file name the user enters in the dialog box, one way to achieve this is to “edit” the file and then save again to the same file name. We can do this by adding a line to clean up the structure and then saving.

try
save first document in (molAttachment) as "MDL Molfile”
--This is to ensure the title of the mol file is set correctly
do menu item "Clean Up Structure" of menu "Structure"
save first document in (molAttachment) as "MDL Molfile"
close first document saving no

If you now look at the mol file in a text editor you can see the title is set more appropriately.

Mol file1.mol
ChemDraw12201319082D

14 16  0  0  0  0  0  0  0  0999 V2000
blog comments powered by Disqus