So I found how to apply an expression in After Effects using a shortcut.
You will need to use automation software to create a macro (performs multiple steps one after another), and control your shortcuts.
Automation software options
Mac: Soundflow (highly recommended), Keyboard Maestro, Stream Deck
Windows: Auto Hot Key, Stream Deck
These are the steps I included in my macro, on Mac:
– Manually select layer
– Press trigger (in my case it’s a stream deck button but it could be a customer keyboard shortcut)
Automated steps:
– Press S to show scale property
– Press Command Alt A (select the visible properties)
– Menu: Animation / Add expression (or use the shortcut)
– Use your automation software to paste a pre-defined expression into the expression area, which is now active
– Press numpad enter to exit the expression editor
So with a single button press, I can apply an expression.
Taking it further, you can make it so that you press a button, and a search option pops up, you type a few letters and then press enter to choose your desired expression, and then it gets applied once you select it. You will need to use an advanced automation platform like Soundflow to get that kind of functionality.