Select Safari Tab Taking Variables?

I have a macro that is a mix if JXA (Javascript for Automation) and Python that reads the currently open tabs in safari and returns them to a List with a Prompt. I'm able to get the window and tab indexes using these scripts, but I need to be able to pull up the correct tab using the index. Are you able to feed the Select Safari Tab action a KM variable? It's returning invalid in the result and it's highlighted red so I'm assuming no.

I was able to get it to work without using the Select Safari Tab action. Ended up finding quite a few AppleScripts that do something similar, but nothing exactly what I was looking for. I wanted to be able to view all open tabs and also have the ability to search. This macro seems to do the trick.

Safari Tabs.kmmacros (5.2 KB)

The Select tab Text Field is a numeric field. So to use a variable in it, you would just use the variable unadorned, eg: “tabIndex”.