(I did search the archives for posts similar to this one; I hope this
isn't retreading old ground.)
I just got Moneywell - it looks great! One thing that I wish it had
is the ability to rewrite imported transactions as they are added.
For electronic payment transactions, my bank sends payee fields that
look like this:
"BILL PAY(907219 ORCC WW Feb 17"
"BILL PAY(089772 ORCC WW Feb 16"
"BILL PAY(019500 ORCC WW Feb 14"
Needless to say, this is frustrating. However, the (larger) memo
fields get more useful info:
"BILL PAY(907219 ORCC WW Feb 17 @ 12:06pm)(Comcast)"
What to do? Well, I opened the Moneywell datafile in a text editor
and found it was a sqlite3 database file, which I can munge with the
command line, since I have sqlite3 installed. I can also wrap these
commands into an applescript. Now I can drag my Moneywell file onto
this applescript (saved as an application), and all my cryptic payees
are magically fixed!
Below, I've provided this for others wanting to do something similar.
It would need to be modified to work with your particular brand of
munged data, or things you wish to alter. I hope this helps others
-Dave
WARNING: THIS COULD DAMAGE YOUR FILE. DON'T DO THIS UNLESS YOU KNOW
WHAT YOU ARE DOING! TEST IT THOROUGHLY ON A COPY FIRST!
Here is the applescript code:
======begin applescript================
property debugging : false
on run
choose file
process_item(the result)
end run
on open (these_items)
if debugging then display dialog "In open handler; found " & (count
of these_items) & " items:" & (these_items as list)
repeat with i from 1 to the (count of these_items)
if debugging then display dialog "In open handler; processing
item
#" & i & ": " & (item i of these_items)
set this_item to (item i of these_items)
set the item_info to info for this_item
if folder of the item_info is true then
process_folder(this_item)
else if (alias of the item_info is false) then
process_item(this_item)
end if
end repeat
end open
-- this sub-routine processes folders
on process_folder(this_folder)
if debugging then display dialog "In process_folder, working on
folder:" & this_folder
set these_items to list folder this_folder without invisibles
repeat with i from 1 to the count of these_items
set this_item to alias ((this_folder as text) & (item i of
these_items))
set the item_info to info for this_item
if folder of the item_info is true then
process_folder(this_item)
else if (alias of the item_info is false) then
process_item(this_item)
end if
end repeat
end process_folder
-- this sub-routine processes files
on process_item(this_item)
do shell script "sqlite3 " & quoted form of the POSIX path of
this_item & " 'UPDATE main.ZTRANSACTION SET ZPAYEE=TRIM(SUBSTR
(ZORIGINALMEMO,41,99),\"()\") WHERE ZORIGINALMEMO LIKE \"BILL PAY%
\";'"
do shell script "sqlite3 " & quoted form of the POSIX path of
this_item & " 'UPDATE main.ZTRANSACTION SET ZPAYEE=\"POS:\"||TRIM
(SUBSTR(ZORIGINALMEMO,50,99),\"()\") WHERE ZORIGINALMEMO LIKE \"POS
PURCHASE%\";'"
do shell script "sqlite3 " & quoted form of the POSIX path of
this_item & " 'UPDATE main.ZTRANSACTION SET ZPAYEE=\"WD:\"||TRIM(SUBSTR
(ZORIGINALMEMO,51,99),\"()\") WHERE ZORIGINALMEMO LIKE \"ATM WITHDRAWAL
%\";'"
end process_item
========end applescript=======
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "No
Thirst Software User Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/no-thirst-software?hl=en
-~----------~----~----~----~------~----~------~--~---