Noob Alert: i cannot get moneybot to list Accounts (Moneydance 2019.1 1855)...

jac's Avatar

jac

29 Mar, 2019 01:31 PM

Hi,

I'm attempting to learn 'py' and 'moneybot' (Moneydance 2019.1 1855) in the hopes to one day automate some processes... i have 'some' experience in programming, but i'm lost trying to figure out the 'apidoc'.

My initial excersise is to list all the accounts in my CurrentAccountBook. I am able to run the 'python_template.py' with no problem. i've been able to modify it to list ALL trxns. i even understand how the classes, methods, etc. work and where to find them in the 'apidoc'.

It's a different story when it comes to Accounts... i get only errors when i try to use 'AccountUtil' or 'AccountIterator' classes.

i'm only trying to list all accounts with various accounts info (fullname, current balance, type, etc.) from my CurrentAccountBook...

I would be happy to send you my embarassingly feable attempts to code this probably very simple task, but there have been so many attempts and i now don't know which attempt seems most logical...

Sorry to waste your time on this. BTW, i have purchsed Moneydance 2019 to get away from Quicken-slave and i love it.

Hopefully, you will allow me to submit questions to guide me through the learning stages of py extentions.

Thanks & Best Regards,
jac

#*************************************************************************

md = moneydance
md_data = moneydance_data
md_ui = moneydance_ui
mb = moneybot

#print "The Moneydance app controller: %s"%(md)
#print "The current data set: %s"%(md_data)
#print "The UI: %s"%(md_ui)
#print "Bot interface: %s"%(mb)

if md_data:
ab = md.getCurrentAccountBook()
print "The AccountBook: %s"%(ab)
account_names = []
for acct in AccountUtil.getAccountIterator(ab):
account_names.append(acct.getFullAccountName())

#*************************************************************************

  1. 1 Posted by hleofxquotes on 01 Apr, 2019 05:26 PM

    hleofxquotes's Avatar

    You need an extra import line

    from com.infinitekind.moneydance.model import AccountUtil
    
    Given,
    from com.infinitekind.moneydance.model import AccountUtil
    book = moneydance.getCurrentAccountBook()
    for acct in AccountUtil.getAccountIterator(book):
      print acct
    

    should print out something like this

    Test
    Checking
    Bank Fee
    Bills
    Bills:Cable
    Bills:Electric
    Bills:Garbage
    Bills:Gas
    Bills:Phone
    Bills:Rent
    Bills:Water/Sewer
    Miscellaneous
    Personal
    Personal:Books/Magazines
    Personal:Computer
    Personal:Dining
    Personal:Entertainment
    Personal:Gifts
    Personal:Groceries
    Personal:Miscellaneous
    Income
    Salary
    Salary:Bonus
    Salary:Commission
    Salary:Paycheck
    
  2. 2 Posted by jac on 04 Apr, 2019 08:16 AM

    jac's Avatar

    Thanks hleofxquotes!

    That was simple enough, eh!

    Best Regards,
    jac

  3. System closed this discussion on 04 Jul, 2019 08:20 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac