tag:infinitekind.tenderapp.com,2009-01-14:/discussions/problems/47682-windows-md-20178-1691-command-line-interface-cli-script-bugsInfinite Kind: Discussion 2018-12-27T19:10:23Ztag:infinitekind.tenderapp.com,2009-01-14:Comment/461041112018-09-18T15:38:57Z2018-09-23T17:50:00ZWindows MD 2017.8 (1691) Command Line Interface (CLI) Script Bugs<div><p>There are two issues :<br>
1. jpython script execution does not work:</p>
<p>This was also the case for MD 2017.6 (1656) (see my original post here:<br>
<a href="http://help.infinitekind.com/discussions/general-questions/51726-windows-md-2017-1656-command-line-interface-cli-script-execution">http://help.infinitekind.com/discussions/general-questions/51726-wi...</a>).</p>
<p>I modified the sample python set securities prices script to update a single security. When I invoke the Python scripting dialog (Ctrl+Shift+2), open the script and run it; it executes perfectly but when I run it via the CLI it fails.</p>
<p>To test the CLI with a command that works I run "C:\Program Files\Moneydance\Moneydance.exe" -invoke moneydance:showabout, I get the about screen displayed as expected.</p>
<p>When I run "C:\Program Files\Moneydance\Moneydance.exe" -invoke moneydance:fmodule:jpython:runfile?=C:\Users<user>\Desktop\Now\Code\Python\Unit\Moneydance\md_set_prices.py, I get nothing, no matter how long I wait.</p>
<p>The path/module name (C:\Users<user>\Desktop\Now\Code\Python\Unit\Moneydance\md_set_prices.py) is the same as used in the invoke the Python scripting dialog.</p>
<p>If I run "C:\Program Files\Moneydance\Moneydance.exe" -invoke_and_quit moneydance:fmodule:jpython:runfile?=C:\Users<user>\Desktop\Now\Code\Python\Unit\Moneydance\md_set_prices.py, MD is launched and shuts down without updating the security price.</p>
<p>I have also checked my syntax with all available documentation here <a href="http://infinitekind.com/dev/urischeme">http://infinitekind.com/dev/urischeme</a>, here <a href="https://infinitekind.com/developer">https://infinitekind.com/developer</a>, and here <a href="http://moneydance.com/help_docs/command_line.html">http://moneydance.com/help_docs/command_line.html</a>.</p>
<p>Please fix this as this is the last major thing preventing me from migrating from Quicken to Moneydance. Using python modules I was able to fully automate my Quicken reporting and data loading, which I will be able to do if the jpython LCI works again.</p>
<ol>
<li>Unable to invoke any report or most graphs:</li>
</ol>
<p>When I run "C:\Program Files\Moneydance\Moneydance.exe" -invoke moneydance:showreport:NetWorthReport I get a java.lang.NullPointerException error dialog box (see attached).</p>
<p>However, if I run the command "C:\Program Files\Moneydance\Moneydance.exe" -invoke moneydance:showreport:NetWorthGraph or the command "C:\Program Files\Moneydance\Moneydance.exe" -invoke moneydance:showgraph:NetWorthGraph the graph is displayed as expected.</p>
<p>Please note, running with the showreport or the showgraph command yields the same result for a given report or graph.</p>
<p>I ran all the reports and graphs listed on <a href="https://infinitekind.com/dev/urischeme">https://infinitekind.com/dev/urischeme</a>, which resulted in all reports failing with the NullPointerException error and most graphs.</p>
<p>Here is a list of my results:</p>
<p>Result....Report or Graph Name</p>
<hr>
<p>Working.NetWorthGraph<br>
Error......AccountBalanceGraph<br>
Error......CurrencyGraph<br>
Working.ExpensesGraph<br>
Error......IncomeExpenseGraph<br>
Working.IncomeGraph<br>
Error......MemorizedGraph<br>
Error......NetWorthReport<br>
Error......AccountBalanceReport<br>
Error......RealDetailedCashFlowReport<br>
Error......RealCashFlowReport<br>
Error......CashFlowReport<br>
Error......DetailedCashFlowReport<br>
Error......TxnReport<br>
Error......BudgetReport<br>
Error......MissingChecksReport<br>
Error......MemorizedReport<br>
Error......CostBasisReport<br>
Error......VATReport (but I don't have VAT/GST setup)</p>
<p>I also had trouble getting this to work in MD 2017.6 (1656) but I don't recall the details.</p></div>md_oztag:infinitekind.tenderapp.com,2009-01-14:Comment/461041112018-09-25T12:06:59Z2018-09-25T12:06:59ZWindows MD 2017.8 (1691) Command Line Interface (CLI) Script Bugs<div><p>It has been 1 week since I posted this. Can someone from MD support please respond regarding the status of these two items.</p>
<p>Thank you</p></div>md_oztag:infinitekind.tenderapp.com,2009-01-14:Comment/461041112018-09-25T13:01:55Z2018-09-25T13:01:55ZWindows MD 2017.8 (1691) Command Line Interface (CLI) Script Bugs<div><p>Ah yes, the command-line interface. I'm sorry to say that that hasn't kept up with the times as on some platforms launching with the command line doesn't really make sense and sometimes isn't possible.</p>
<p>In this case I'd guess that it fails because even though Moneydance and the extension itself are loaded when the URI is invoked, that the data file itself hasn't loaded. For the short term, I'd recommend one of two options:<br>
1.Run the script with the python script runner under the window menu. That uses the built-in python environment rather than the extension which we're no longer working on. 2. Package an extension (either from a python script or java/kotlin code) and have it run your automated tasks upon receiving notification that a file has been loaded.</p>
<p>Speaking of extensions and python scripting, Moneydance 2019 will have far better support and capabilities for python scripts, both running them directly as well as packaging them in a flexible way as extensions.</p>
<p>All the best,</p>
<p>Sean Reilly<br>
Developer, The Infinite Kind<br>
<a href="http://infinitekind.com">http://infinitekind.com</a></p></div>Sean Reillytag:infinitekind.tenderapp.com,2009-01-14:Comment/461041112018-09-25T13:04:51Z2018-09-25T13:04:51ZWindows MD 2017.8 (1691) Command Line Interface (CLI) Script Bugs<div><p>Sorry, I should add that I'd like to back away from allowing the invoking of scripts from URIs (at least URIs invoked from outside of Moneydance), since it would make it trivial for some bad software to invoke Moneydance and run a nasty script that damaged or accessed your data without any confirmation step.</p>
<p>Thanks,</p>
<p>Sean Reilly<br>
Developer, The Infinite Kind<br>
<a href="http://infinitekind.com">http://infinitekind.com</a></p></div>Sean Reillytag:infinitekind.tenderapp.com,2009-01-14:Comment/461041112018-09-27T19:03:28Z2018-09-27T19:08:54ZWindows MD 2017.8 (1691) Command Line Interface (CLI) Script Bugs<div><p>Sean,</p>
<p>Thank you for your response.</p>
<p>#2 is beyond my current technical knowledge, but I can manually execute #1 for now.</p>
<p>Currently, I use Quicken as my books and records, with all investment analysis, stock selection, etc. done in a custom python environment. I invoke Quicken through a batch python process to extract and update information.</p>
<p>For example, dump balances, holdings & security master from Quicken, do my asset allocation/rebalance analysis in python, perform stock trades with my broker, and then use a python batch process to automatically update Quicken with any new securities that result. That way when security transactions flow into Quicken from my broker the security reference data has already been added. I have daily, weekly, monthly and annual regularly scheduled python scrips to perform these kinds of tasks automatically and I only have to review the resulting outputs.</p>
<p>I was hoping to do something similar with MD. Right now I have to logon to MD, run a dump script via the python interpreter, wait for a non-MD batch python processing script to complete, logon/stay on MD to run an update script via the python interpreter. I hope that the improvements in 2019 will make this a little easier.</p>
<p>I can't wait to see what the new capabilities of MD2019 are.</p>
<p>Thank you again and keep up the good work.</p></div>md_oz