Skip to content

Instantly share code, notes, and snippets.

@skorfmann
Last active October 19, 2023 21:58
Show Gist options
  • Save skorfmann/b33a6392632baa6649ace639fe6e5aca to your computer and use it in GitHub Desktop.
Save skorfmann/b33a6392632baa6649ace639fe6e5aca to your computer and use it in GitHub Desktop.

MoneyMoney CSV Export with Apple Script and Automator

  • adjust set accounts to {"IBAN 1", "IBAN 2"}
  • replace yourPassword with your MoneyMoney password
  • replace /your/local/path/ with your actual target path
  • set the time range set yesterday to (today - (1 * days))

Load this file in Automator and get fully automated exports.

on run {input, parameters}
set accounts to {"IBAN 1", "IBAN 2"}
set today to (current date)
set yesterday to (today - (1 * days))
tell application "System Events"
set isRunning to (count of (every process whose name is "MoneyMoney")) > 0
end tell
if not isRunning then
tell application "MoneyMoney"
activate
delay 2
end tell
end if
tell application "System Events"
tell process "MoneyMoney"
if exists (window "MoneyMoney") then
set winTexts to static text of window "MoneyMoney"
set allText to ""
repeat with txtItem in winTexts
set allText to allText & (name of txtItem) & linefeed
end repeat
if allText contains "Please enter your database password:" then
set frontmost to true
delay 1
set value of text field 1 of window "MoneyMoney" to "yourPassword"
keystroke return
else
display dialog "Text not found in window."
end if
else
display dialog "Window not found."
end if
end tell
end tell
delay 30 -- Wait to load and update all accounts
repeat with accountNumber in accounts
tell application "MoneyMoney"
set startDate to (yesterday as string)
set endDate to (today as string)
set result to export transactions from account accountNumber from date startDate to date endDate as "csv"
end tell
do shell script "mv " & POSIX path of result & " /your/local/path/" & accountNumber & ".csv"
end repeat
delay 5
tell application "MoneyMoney" to quit
return input
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment