GUIs are almost entirely non-scriptable. Some exceptions exist, but they're few and extremely limited compared to what you can do with a CLI. (Note I said CLI. A TUI is almost always a GUI made of text, and is just as non-scriptable.)