Macs in Chemistry

Insanely Great Science

ChemDraw and dialog boxes

The upgrade to Mac OS X 10.6 (Snow Leopard) has caused a number of problems for ChemBioDraw (aka ChemDraw) users. One particular problem is the upgrade appears to have broken the ability to enter text into dialog boxes. Whilst this has been fixed in an update to version 12 of ChemBioDraw Cambridgesoft seem reluctant to provide an update for earlier versions of the software, suggesting instead that users should upgrade.

Unfortunately I don’t have ChemBiodraw 11 (or earlier versions) so I can’t explore the problem but perhaps it might be possible to offer a work around using Applescript.

This applescript which can be
downloaded here aims to replace a ChemBioDraw dialog using an Applescript dialog.

display dialog "Paste_As" default answer "Type Text Here" buttons {"Cancel", "SMILES", "Name"} default button 3
copy the result as list to {text_returned, button_pressed}

if the button_pressed is "SMILES" then
set the clipboard to text_returned
--You may need to rename depending on version to "CS ChemBioDraw Std" or "CS ChemBioDraw Pro"
tell application "CS ChemBioDraw Ultra"
activate

if enabled of menu item "Paste" then do menu item "SMILES" of menu "Paste Special" of menu "Edit"
end tell
else
if the button_pressed is "Name" then
set the clipboard to text_returned
--You may need to rename depending on version to "CS ChemBioDraw Std" or "CS ChemBioDraw Pro"
tell application "CS ChemBioDraw Ultra"
activate

if enabled of menu item "Paste" then do menu item "Name as Structure" of menu "Paste Special" of menu "Edit"
end tell

end if
end if

The script needs to be placed in the ChemDRaw Items folder as shown below.




When you now start ChemBioDraw you should find an extra menu item called Scripts.



If you click on this you should see a drop down list of scripts, click on “Chemdraw_Paste_As.scpt” it should open a dialog box, type (or paste) in either a SMILES string or the chemical structure name and click the appropriate button and hopefully the structure will be generated.

As I mentioned I don’t have a machine to test this on so if someone could try it out I’d be grateful. If it works I might be able to look at helping out with other dialog boxes.
blog comments powered by Disqus