I saw Using applescript to create spaces and launch apps, but the provided AppleScript didn't work.
I did some reading to understand what was happening, and how they selected the right UI element, in case that was all that had changed. Thanks to How to know the name of UI elements using Accessibility inspector (or any other tool), I can understand how one would compose a script like this, but it feels too hacky that the best way to add a new space is via affecting a user clicking.
I want to be able to create or delete spaces with AppleScript. Is there a better way than using AppleScript to click GUI buttons?