Touch bar of opening a specific page in google chrome

I do not understand how I can make it so that a certain link opens in a pinned tab in Google Chrome, and not in a new window in the browser, since this does not suit me, since the table takes up a lot of memory and it takes a long time to load, I need it to open. the tab that I need (it is pinned in the browser). not in a new window
Снимок экрана 2021-12-04 в 12.34.09 PM

This AppleScript open the specific page in the tab of your picture (index number 2):

-- Change the Url and the Tab index as you like:
set theURL to "https://community.folivora.ai/t/touch-bar-of-opening-a-specific-page-in-google-chrome/25145"
set theTabIndex to 2

-- Activate the Tab
tell application "System Events"
	tell application process "Google Chrome"
		tell window 1
			tell group 1
				tell tab group 1
					tell radio button theTabIndex
						click
					end tell
				end tell
			end tell
		end tell
	end tell
end tell

-- Open the Url
tell application "Google Chrome"
	set URL of active tab of front window to theURL
end tell

However, the script fails if the tab does not exist (e.g. Chrome was closed and reopened).

hello Could you please throw me a preset for this purely this script, since I can't do it, it gives an error

I don't have a preset for it - just the script and it works for me with Google Chrome 96:

Note: It fails if Chrome is not running, has no window, or has less than two tabs. But that was the requirement (explicitly not to open a new tap or window),

I get it. Can you show me how you did it? just in the program ... and how can I make sure that the tab that it opens so that it does not update, I will be very grateful to you

Look, I have such a task, I have 5 pages on tables, I have them all fixed in google chrome, and I need each button to be responsible for opening its tab in google chrome (when it is open, it suits me) and so that the tab does not update like this as there the tables are very CPU intensive and take time, you need it to open that window and that's it.

Use only this part in a BTT AppleScript action:

-- Change the Tab index as you like:
set theTabIndex to 2

-- Activate the Tab
tell application "System Events"
	tell application process "Google Chrome"
		tell window 1
			tell group 1
				tell tab group 1
					tell radio button theTabIndex
						click
					end tell
				end tell
			end tell
		end tell
	end tell
end tell

For testing you can use the Script Editor.

Create several actions and change this line to 1, 2 … 5 to activate Tab 1, 2 … 5:

set theTabIndex to 2

thank you