Macs in Chemistry

Insanely Great Science

questions

ChemDraw and Word compound numbering on Mac

A while back I got this question

”I’m about to hit the tedious part of writing my chemistry PhD thesis in Microsoft Word: having all mentioned compounds numbered in text and in the chemdraw imported files. My question: is there any automated option for this task or do I have to insert every number manually? In particular renumbering after adding a new compound in the middle of the text”

There are a couple of ways to do this in LaTex (http://www.jkwchui.com/2010/03/writing-chemistry-with-latex-33/) and (http://piti.exroot.org/konwerter/) but in my experience LaTex is not particularly popular among chemists. However help is at hand, I’ve just been sent details of a brilliant applescript that works with ChemBioDraw and Word.

The process is described in detail here (http://www.martinp23.com/blog/2013/03/chemdraw-and-word-compound-numbering-on-mac/) so I won’t give anymore details just to add that one thing I’ve been using in recent Chemdraw scripts is

tell application id "com.cambridgesoft.ChemDraw"

It avoids the problems with application naming with different versions of Chem(Bio)Draw Std/Pro/Ultra.

There are many more applescripts here.



Comments

Automatic numbering of compounds in documents

I was recently asked this question.

”I’m about to hit the tedious part of writing my chemistry PhD thesis in Microsoft Word: having all mentioned compounds numbered in text and in the chemdraw imported files. My question: is there any automated option for this task or do I have to insert every number manually? In particular renumbering after adding a new compound in the middle of the text”

After a little discussion here is an example of what might be required

The photophores used today are generally phenylazides (##), phenyldiazirines (##), or benzophenones (##), which produce nitrenes, carbenes, or diradicals, respectively.

I guess what it requires is the use of some sort of Word-internal "field codes" (?, or other functional unit from Word architecture) to assign a unique name first. e.g.

The photophores used today are generally phenylazides ({chemID="phenyla"/#}), phenyldiazirines ({chemID="phenyld"/#}), or benzophenones ({chemID="benzoph"/#}), which produce nitrenes, carbenes, or diradicals, respectively.

So if I was to use e.g. phenylazides later on again, I could just insert the same field code as before (here: {chemID="phenyla"/#}). At the end, when Word updates all the field codes, each compound is assigned a number (starting with 1 for first compound ever mentioned, replacing the # sign in the field code). At least then if you shuffle some paragraphs (or one's supervisor considers it extremely important to insert this one more structure in your introduction), then the in-text numbering is sorted automatically.

There are a couple of ways to do this in LaTex (http://www.jkwchui.com/2010/03/writing-chemistry-with-latex-33/) and (http://piti.exroot.org/konwerter/) but in my experience LaTex is not particularly popular among chemists. Anyone know of a tool for doing this in Word, Pages or other word processors?

Comments

Adding drop shadows to chemical structures

As part of my day job I maintain Drug Discovery Resources a website intended to act as a resource for scientists undertaking drug discovery. One part of the site has a section on bioisosteres including many examples http://www.cambridgemedchemconsulting.com/resources/bioisoteres/ in which the chemical structures are shown with dropped shadows.

I use ChemBioDraw to draw the structures and then save as PNG files with a transparent background. The structures are then dropped onto webpages created using RapidWeaver, within RapidWeaver there is an option to add dropped shadows to images. I was recently asked whether there was any other way to create the same effect and Matt at macosxtips suggested using ImageMagick. This applescript droplet allows you to do so by simply dropping the file.

Comments

Copy file to Dropbox and email link

A while back I posted a script that copied a file to a users MobilMe Public folder and created an email link to that file. With the imminent demise of MobileMe a couple of people have asked me for a script that does the same but uses Dropbox.

This script shows how to copy a file to your Dropbox Public folder and then email a link to it.

Comments

Script to email Chemical Structures

A reader commented that they often emailed ChemBioDraw .cdx structures to colleagues who it turned out did not have a copy of ChemBioDraw to view them, whilst it is possible to convert the cdx file to other formats using OpenBabel they usually just ended up exchanging an image. They asked if there was a better solution and this is an ideal task for Applescript. This script assumes the structure you want to email is open in ChemBioDraw, it will create an email using Apple Mail containing the structure as a SMILES string, and embed the .cdx file together with an image in PNG format.

Comments

Scripting ChemBioDraw

A script to convert .cdx to .png file format Read More...
Comments