Select Category in Banktivity

I've found it tedious to change categories in Banktivity, especially when trying to find a subcategory. I put together a small macro that pulls all the categories and gives you a list that allows better searching and then assigns the category to the transaction.

Details

I first get a list of all categories from the menu bar

tell application "System Events"
	tell process "Banktivity 6"
		return name of every menu item of menu 1 of menu item "Change Category" of menu 1 of menu bar item "Transaction" of menu bar 1
	end tell
end tell

I then replace the commas with new lines so that KM can display them as a list.

Once the category is chosen, the menu item is clicked and the category assigned.

const BANKTIVITY = 'Banktivity 6'

const app = Application(BANKTIVITY);
app.includeStandardAdditions = true;

const SystemEvents = Application('System Events');
const BanktivityProcess = SystemEvents.processes[BANKTIVITY];

const kme = Application("Keyboard Maestro Engine");
const selectedCategory = kme.getvariable('BanktivityCategory').trim();

BanktivityProcess
  .menuBars.at(0)
	.menuBarItems.byName('Transaction')
	.menus.at(0)
	.menuItems.byName("Change Category")
	.menus.at(0)
	.menuItems.whose({title: selectedCategory}).at(0)
	.click()

Add Category.kmmacros (4.5 KB)

1 Like

Great to see a fellow Banktivity user! Heaven knows Banktivity’s UI is rather less that ideal.

Agreed! It's been my life's goal to try to automate their transaction import flow. Even GUI scripting has been a pain to get it to work.

1 Like

The sad part is that one of my most used macros is Option-Tab mapped to pressing Tab five times to make up for their ridiculous data entry UI.

The app is unfortunately very confusing. It's still the best of the available options, but I can't say I love it. I've had no luck getting the regex matching to work for similar transaction names in rules.

1 Like

I haven't tried the downloaded statements (I don't really want yet another subscription).

I've personally found the subscription useful. Part of the reason I'm bad about tracking money is I forget to track it.

I use Actual for mac and soon iOS.

I find its UX really great. It's cheaper and cleaner version of YNAB. The dev behind it also made Prettier.

Here's an update to my Banktivity macros. It's updated to support Banktivity 7. I also added another macro for easily tagging transactions

Banktivity Macros.kmmacros (8.7 KB)

@peternlewis curious if you have any other useful macros you're using on a regular basis in Banktivity

I have a number of Banktivity macros. I manually enter all my receipts, and manually reconcile my bank statements, so a lot of my Banktivity macros relate to that.

I have many in the form of quick entry macros, all with option-letter hot keys, such as:

  • Trigger: ⌥B
  • Insert text by typing “%Tab%Bakery%Tab%%Tab%%Tab%%Tab%%Tab%8.50%Tab%”
  • Type Shift-Tab

After entering the date, I press this, and it enters the rest of the fields (pressing all those inane Tabs caused by Banktivity’s moronic interface!) and then shift-Tabing to reselect the amount so I can enter it in if it is different to usual.

I have a couple macros that do quick calculations, GST (or ex-GST), from US$, etc. Basically just:

  • ⌘A
  • Copy
  • Set Variable Value to %SystemClipboard%
  • Search & Replace to remove the $ sign
  • Set Variable Value to ROUND(Value/11 * 100)/100 (or whatever)
  • Insert Text by Typing %Variable%Value%
  • Delete Current Clipboard

Super Tab:

  • Trigger Option-Tab
  • Repeat 5 times
    • Tab

That I need the Super Tab macro, and that I have used it over a thousand times speaks to the sadness that is Banktivity’s UI.

I also have a macro that displays a ruler on the screen (a Custom HTML Prompt action) that I can use to keep track of where I am in the reconciliation (open in Preview as a PDF), moving down a line with a key press. That is quite handy, but I doubt it's useful to anyone else.

@rjames86 I was just searching the forum for Banktivity and came across your post re: the Banktivity regex matching. I've had it basically working for a while now.

First off, I agree - Banktivity is extremely painful but still probably my best option. I search for a replacement probably every year hah.

The default regex matching is atrocious and criminal even. For some reason in 2025 the incoming Bank info is still terrible: "PAYPL 99383 SRFFD 444" or whatever and the fact that Banktivity's 'default' matching inputs a regex that tries to match EXACTLY this quoted line is beyond impractical since it seems like all incoming transaction data is unique.

Anyhow, if you still are having issues, here's what I did. Please keep in mind this was a while ago and I can't remember the exact details because Banktivity is already a labyrinth.

The first thing I did was turn off the option in preferences to "Create Import Rules When Editing Transactions". This will just add useless rules to your import rules. Then I wiped out ALL my existing Payees (I don't believe this will change existing transactions - but of course backup your data file either way). Then I created a simple Spreadsheet with 2 columns. The left column had the Payee name how I wanted it and the right column had the Regex rule. I created a KM macro (which is now certainly out of date) to add all the Payees (copying the Payee from the spreadsheet then back to Banktivity to Paste etc). I think in Banktivity 5 or 4 even, you could create the Payee and create the rule on the same page but now I believe you have to create the Payee and then move to the "Import Rules" tab to edit the rules. So I think my Macro created the Payee and then clicked the "Edit" button and added the rule. In any case in can be done.

Then the Rules themselves were very simple:

(?i).*AT&T.*Mobile.*
(?i).*AT&T.*Wireless.*

etc.

Whenever I do a new Download I look at the existing Incoming Payees and then create additional rules with MY regex for those. At one point I would take note of all the new payees, then close the Banktivity Document without saving the new downloads. I would re-open it, add the new payees and then download the transactions again. This seems wonky though and made me wonder if even though the Data file wasn't updated, something else was making Banktivity think it 'already downloaded these transactions'.

In any case, years later I do very little Categorizing.

I've found that the "Account" and "Withdrawal" or "Deposit" sections of the rules do absolutely NOTHING. Which is really unfortunate because I'd like to have a rule for some Payees, where if it's on THIS account then it's THIS category, whereas this other account, this other category - but years later this is still not an option. They need Import Rules tied to different Accounts.

Anyway, hopefully this helps someone.

1 Like