Putting OS.execute(OS.get_executable_path(), ["-p"], false)
will run a new instance of the Project Manager -- "-p"
can be replaced with "--project-manager"
. Putting "-e"
or "--editor"
will open a new instance of the Godot Editor, opening the project you are currently running.
That false
has the execution take place on another thread, allowing the main thread to continue going; otherwise, it would be blocked and could only resume once OS.execute(...)
has finished doing its thing. More information on OS
can be found here, in the online documentation (linked doc is "stable", so this may change with future releases).
Also, you could hard-code the path to the executable on your machine, but as one could imagine, this would instantly break if run on any other machine, so putting OS.get_executable_path()
is best practice.