Need help with code for Templater

I’m trying to add an advanced replacement for Daily Note. I would like Obsidian with Templater to do the next things for me by hot key:

  1. activate the tab with today’s daily notes if this tab is already open
  2. open a tab with today’s daily notes if this tab is not opened
  3. create file with today daily not if it isn’t created yet
  4. put text ———⟨ YYYY-MM-DD HH:mm:ss ⟩———— to end of file
  5. put cursor on the next line and scroll down to the maximum

But only success only with latter two. Also, this.app.workspace.activeLeaf.view.editor.scrollTo(0, 999...999); is not good, but working. Could you help with replace of this?

At first three I stuck to found methods. How to:

  1. get a list of opened tabs?
  2. activate some found tab?

Others probably could be done by Templater methods. Ofc, I’ll appreciate any code which can help me. Thanks!