Python help - switch memo and description
I've imported a lot of data and my memos and descriptions are backwards. I've made changes since then and don't want to reimport.
Can anyone suggest a python snippet to switch memo and description for every transaction? I have some very basic experience with python, but none with python within Moneydance.
Thanks in advance.
Comments are currently closed for this discussion. You can start a new one.
|?||Show this help|
|ESC||Blurs the current field|
|r||Focus the comment reply box|
|^ + ↩||Submit the comment|
You can use
Command ⌘ instead of
Control ^ on Mac
1 Posted by Paul on 16 Nov, 2016 07:05 AM
Here's what I have so far. It gets memo and description info fine, and ignores splits and transactions with no memo.
But trying to actually edit the transaction yields nothing. The transactions stay as they were. What am I missing?
# Python script to be run in Moneydance to perform amazing feats of financial scripting
from com.infinitekind.moneydance.model import *
# get the default environment variables, set by Moneydance
print "The Moneydance app controller: %s"%(moneydance)
print "The current data set: %s"%(moneydance_data)
print "The UI: %s"%(moneydance_ui)
txnSet = moneydance_data.getTransactionSet()
counter = 0
for txn in txnSet.iterableTxns():
continue # it's a split transaction. ignore and loop again
pass # it's not a split transaction. let's keep going
desc = txn.getDescription()
memo = txn.getMemo()
if memo != '':
2 Posted by virantha on 16 Nov, 2016 03:52 PM
Have you tried calling .syncItem() on your txn after changing it?
3 Posted by Paul Wirth on 17 Nov, 2016 12:22 AM
System closed this discussion on 16 Feb, 2017 12:30 AM.