Hi, is there a way to open a tab for a new or inherited scene via code, like Scene → New or Scene → New Inherited Scene in the editor menu do? The only functionality I see coming close is EditorInterface.open_scene_from_path(), but that only works with an existing scene, obviously.
@tool
extends EditorScript
func _run() -> void:
# Get the editor's base control
var base_control = EditorInterface.get_base_control()
# Get the editor title bar (the one with Scene Project Debug ...)
var editor_title_bar = base_control.find_child('*EditorTitleBar*', true, false)
# Get the first PopupMenu (Scene)
var scene_popup = editor_title_bar.find_children("*", "PopupMenu", true, false)[0] as PopupMenu
# Get the id of the first item (New Scene)
var id = scene_popup.get_item_id(0)
# Emit the "id_pressed" signal
scene_popup.id_pressed.emit(id)