Jump to content

Help with scripting action needed


mse

This topic is 7211 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have a very limited experience with AppleScript and need your help.

In my (chemical) Compounds.fp7 file, I have a FM script which copies the content of a container field, Structure (picture), and calls, via AppleScript, another app, CS ChemDraw Ultra, to perform calculations on the Structure. The result of the calculation (e.g. Molecular Formula in the example below) returns into an another field (MolFormula) of Compounds.fp7. For example, if the Structure field contains benzene structure (a sort of hexagon, you remember?), the MolFormula field will be populated with "C6H6" etc.

tell application "CS ChemDraw Ultra"

activate

open file "Macintosh HD:Users:mse:Documents:FileMaker:Matrix2:Template"

if enabled of menu item "Paste" then

do menu item "Paste"

set theMolformula to Molecular Formula of selection

end if

quit saving no

end tell

tell application "FileMaker Developer"

activate

set cell "MolFormula" of current record to theMolformula

end tell

CS ChemDraw Ultra can also generate correct chemical name from structure (menu item "Convert Structure to Name"). However, in this case the situation is different: to generate names CS ChemDraw Ultra calls an external modul (so, - do menu item "Convert Structure to Name" - is inevitable) and the result returned is the structure and its name selected together. By clicking ChemDraw window outside the selection, it is possible to separate them manually to the structure and the text. The text can next be selected and transfered to FMP file.

Question: Is it possible to script this process of separation/selection? With a tiny hope for success, I am attaching for your kind attention the CS ChemDraw Ultra (AppleScript) Dictionary.

Thank you in advance for your time and consideration confused.gif

Link to comment
Share on other sites

This topic is 7211 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.