Product: ChemBioDraw
How to convert .cdx files to .gif or .png
I'd like to batch convert from cdx to image files (gif or png). This is certainly possible one at a time via ChemDraw but I need to convert many structures. Chemscript 12 doesn't seem to handle this since neither type is included in "StructureData.MimeTypes()" and "m.WriteFile('output2.gif')" fails with "Bad mimetype: image/gif". I wrote a small Script via "AutoIT". Maybe this helps you: #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.6.0 Author: Arsimael Script Function: Convert Chemdraw Files to .tif files. #ce ---------------------------------------------------------------------------- #include $sPfad = "C:\chemdraw\in" If StringRight($sPfad, 1) = "\" Then $sPfad = StringTrimRight($sPfad, 1) $aFiles = _FileListToArray($sPfad, "*.cdx", 1) If Not @error Then For $i = 1 To UBound($aFiles) - 1 $sCur = $sPfad & "\" & $aFiles[$i] ShellExecute($sCur) WinWaitActive("ChemDraw Std") sleep (100) Send("^+s") WinWaitActive("Speichern unter") sleep (150) Send("{TAB}") Send("t") Send("C:\chemdraw\out\" & $aFiles[$i]) Send ("{BS 4}") Send(".tif") Send("!s") sleep (50) Send ("^w") sleep (100) filedelete ("C:\chemdraw\in\" & $aFiles[$i]) Next Else MsgBox(64, "Nichts zu tun", "Keine Daten zum konvertieren vorhanden!") EndIf you just have to edit the code that the script produces .gif and not .tif
Comments
0 comments
Article is closed for comments.