Virtual desktops good! Default MacOS behavour bad.
-
Install Alfred.
-
Buy the pro version.
-
Select Workflows and create a blank workflow.
-
Enter the following info:
Field Value Name Create a new desktop. Description Creates a new virtual desktop using a script. Category Productivity -
Click Create.
-
Right-click in the workflow panel and select Input > Keyword.
-
Enter the following information:
Field Value Keyword desktop Arguments dropdown No arguments Title Desktop Subtitle Creates a virtual desktop. -
Right click the block that was just created and select Insert after > Actions > Run script.
-
Set the Language to osascript (AS).
-
Leave with input as argv and running instance sequentially as their defaults.
-
Paste the following code into the textbox:
#!/usr/bin/osascript tell application "System Events" do shell script "/System/Applications/Mission\\ Control.app/Contents/MacOS/Mission\\ Control" click button 1 of group "Spaces Bar" of group 1 of group "Mission Control" of process "Dock" do shell script "/System/Applications/Mission\\ Control.app/Contents/MacOS/Mission\\ Control" end tell
-
Click Save.
-
Open Alfred and search for
desktop
. -
That’s it!
Now, every time you search for desktop
in Alfred, MacOS should create a new desktop for you! You could also follow the steps above to create a script to delete an open desktop if you were so inclined.