Check outlook email

Is there a way to create a button or widget that checks for Outlook unread email count in the background? I want it to be able to check if I have new emails right from the touchbar and it'll open Outlook when tapped.

I know next to nothing about apple scripting so I'm looking for some help. The closest thing I found when searching online is this page but the script doesnt work: