Open iterm and execute command

Hello, I bought BTT and I am trying to configure my new MacBook Pro 16.

What I want:

  1. When clicking f12 on the touch bar then I want to see iterm terminal, which executes me command "start_my_current_project" and showing me it on a fullscreen.

  2. On f1 I want to show iterm terminal if exist in current desktop or create a new instance if not exist

Can you help me to achieve it? Not sure yet how to search for information in this community.

iTerm has a python API that could be used:
https://iterm2.com/python-api/examples/launch_and_run.html

This could then be triggered using the "execute terminal command" action in BTT.

Alternatively iTerm also has a old, deprecated Apple Script API: https://apple.stackexchange.com/questions/286943/how-do-i-write-a-script-that-opens-an-iterm2-window-and-runs-a-command (which could be triggered using the "Run Apple Script" action in BTT.