How do i change tabs in a tab container from outside the scene?

Godot Version

Godot 4.2.1

Question

Basically, i have my main scene called Menu with 3 rows of buttons, and in each row there are a bunch of buttons, now row of buttons navigates to a specific scene, and each button in the row navigates to a specific tab in that scene

For example, here is the progression:
Main Menu Scene → First Row → First Button = First Tab of the First Scene
Main Menu Scene → First Row → Second Button = Second Tab of the First Scene

ect ect’

I have tried to achieve this by using groups and calling the TabContainer in each scene but i havent figured it out yet, ChatGPT mentioned calling the ready() method of the First Scene in the Main Menu Scene and use that

Here is a code snippet:

extends ScrollContainer

# Define a variable to store the tab index
var selected_tab_index : int = 0

func _on_basic_button_pressed():
	# Set the tab index for Basic Tab
	selected_tab_index = 0
	
	# Load Basic Tab
	change_tab()

func _on_privilege_button_pressed():
	# Set the tab index for Privilege Level Tab
	selected_tab_index = 1
	
	# Load Privilege Level Tab
	change_tab()

func _on_ssh_button_pressed():
	# Set the tab index for SSH Tab
	selected_tab_index = 2
	
	# Load SSH Tab
	change_tab()

func _on_telnet_button_pressed():
	# Set the tab index for Telnet Tab
	selected_tab_index = 3
	
	# Load Telnet Tab
	change_tab()

func load_tab_scene():
	# Load the scene into the TabContainer
	get_tree().get_nodes_in_group("Group")
	var tabContainer = $UserLevel/TabContainer
	if tabContainer:
		tabContainer.current_tab = selected_tab_index
		tabContainer.clear()
		get_tree().change_scene_to_file("res://Scenes/UserLevel.tscn")


func change_tab():
	get_tree().call_group("Group", "ChangeTab")
	get_tree().change_scene_to_file("res://Scenes/UserLevel.tscn")

Any help would be very appreciated, Thanks!