tag:infinitekind.tenderapp.com,2009-01-14:/discussions/moneydance-development/2514-auto-run-an-extensionInfinite Kind: Discussion 2019-06-19T19:50:43Ztag:infinitekind.tenderapp.com,2009-01-14:Comment/473556552019-06-14T20:24:18Z2019-06-14T20:24:18ZAuto Run an Extension<div><p>My apologies if this has been asked/answered. I could not find any discussions or documentation.<br>
I have an extension I developed for my personal updating. It takes input from a file I generate overnight and updates an asset with transactions to maintain a current balance. I run it each morning when I open MD. Can someone guide me to a way to have MD run this when it starts? I know, I'm extremely lazy! More of an educational thing for me.</p>
<p>Thanks in advance.</p>
<p>Dan</p></div>Dan Ptag:infinitekind.tenderapp.com,2009-01-14:Comment/473556552019-06-15T05:30:01Z2019-06-15T05:30:01ZAuto Run an Extension<div><p>Assuming that your extension extends FeatureModule, you can override handleEvent(). Probably "md:file:opened" is a good place to try</p>
<pre>
<code> @Override
public void handleEvent(String appEvent) {
super.handleEvent(appEvent);
LOGGER.info("> handleEvent, appEvent=" + appEvent);
if (appEvent.compareToIgnoreCase("md:file:opening") == 0) {
handleEventFileOpening();
} else if (appEvent.compareToIgnoreCase("md:file:opened") == 0) {
handleEventFileOpened();
} else if (appEvent.compareToIgnoreCase("md:file:closed") == 0) {
handleEventFileClosed();
}
}
protected void handleEventFileOpened() {
}</code>
</pre></div>hleofxquotestag:infinitekind.tenderapp.com,2009-01-14:Comment/473556552019-06-16T16:44:58Z2019-06-16T16:44:58ZAuto Run an Extension<div><p>Thanks! I'll give it a go.</p></div>Dan P