Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

The Mathematica kernel can generally open a notebook and evaluate the functions present in the notebook using UsingFrontEnd Command.

Example:

UsingFrontEnd[SelectionEvaluateCreateCell[nb];]

However, when I try from Java the following command, no action happens:

m1.evaluate("UsingFrontEnd[SelectionEvaluateCreateCell[nb];]"); 

Can anyone please explain how I can evaluate expressions in some notebook file through Java.

Note: I have tried all options like NotebookEvaluate, SelectionEvaluate, etc. I have also tried different combinations of SelectionMove.

share|improve this question
    
There appears to be Mathematica syntax errors in the string you are supplying to your evaluate method. SelectionEvaluateCreateCell requires one or two arguments. Further, the terminating semicolon ( ; ) suppresses anything returned by your expression and forces Null to be returned. –  m_goldberg May 22 at 12:43
    
There was a typo in the question. I have edited it. And I also tried without semi colon and that produced the same results –  RituD May 23 at 7:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.