I wanted to switch VSCode font size based on monitor; external monitor had too big resolution, the built-in had tiny one. I switch from big one to built-in one all the time.
So I put together a JXA. It's very hacked together, you will need to change the details if you want to use it. (The name of the monitor, the font size.)
Put it whenever as "vscode.js" and run osascript vscode.js
.