"Move Window To Desktop #"-action setting not working

When the "Only Move Window, Do NOT Switch To Space"-setting – in the "Move Window To Desktop #"-action – is checked nothing happens.

I tested both in alpha and in the latest stable release

Device information:

  • Type of Mac: Macbook Pro M1 Max
  • macOS version: 15.1 (24B83)
  • BetterTouchTool version: 4.839

Unfortunately this only works up to and including macOS 14. Unfortunately Apple has blocked all remaining ways to achieve this on macOS Sequoia.

I'll make sure to hide the option soon.

FWIW, I created this work around.

Note: it doesn't prevent the moving to the target space for the window; but it does instantly revert you to the original space after the window has been moved to the target space.

Note: Requires installation of WhichSpace app, from: macos - osx - script to get current desktop number - Stack Overflow

Note: Requires "Switch to desktop..." shortcut keys to be enabled in the Mission Control section of the Keyboard Shortcuts section of the Keyboard System Settings. There may be a way to more elegantly switch to a space, programmatically, but having trouble finding it. Seems Spaces scripting is very un-developed by Apple.

Note: the delays included in the script may need to be adjusted for your machine to achieve optimal performance.

Instructions: For whatever trigger you've selected, after the "Move Window to Desktop X" action, create a "Run Apple Script" action, with the following AppleScript code:

tell application ¬
	"System Events" to tell process ¬
	"WhichSpace" to set WhichSpaceDump to (title of menu bar items of menu bar 1)
set SpaceNum to item 1 of WhichSpaceDump

delay 0.1

--Delay switching back to original space until the BBT menu has been activated and resulted in a change of space
tell application ¬
	"System Events" to tell process ¬
	"WhichSpace" to set WhichSpaceDump to (title of menu bar items of menu bar 1)
set CurrentSpaceNum to item 1 of WhichSpaceDump

repeat until CurrentSpaceNum is not SpaceNum
	tell application ¬
		"System Events" to tell process ¬
		"WhichSpace" to set WhichSpaceDump to (title of menu bar items of menu bar 1)
	set CurrentSpaceNum to item 1 of WhichSpaceDump
	delay 0.1
end repeat


delay 0.1

if SpaceNum is "1" then
	delay 0.1
	tell application "System Events" to key code 18 using {control down}
end if
if SpaceNum is "2" then
	delay 0.1
	tell application "System Events" to key code 19 using {control down}
end if
if SpaceNum is "3" then
	delay 0.1
	tell application "System Events" to key code 20 using {control down}
end if
if SpaceNum is "4" then
	delay 0.1
	tell application "System Events" to key code 21 using {control down}
end if
if SpaceNum is "5" then
	delay 0.1
	tell application "System Events" to key code 23 using {control down}
end if
if SpaceNum is "6" then
	delay 0.1
	tell application "System Events" to key code 22 using {control down}
end if
if SpaceNum is "7" then
	delay 0.1
	tell application "System Events" to key code 26 using {control down}
end if
if SpaceNum is "8" then
	delay 0.1
	tell application "System Events" to key code 28 using {control down}
end if
if SpaceNum is "9" then
	delay 0.1
	tell application "System Events" to key code 25 using {control down}
end if
if SpaceNum is "10" then
	delay 0.1
	tell application "System Events" to key code 29 using {control down}
end if
if SpaceNum is "11" then
	delay 0.1
	tell application "System Events" to key code 18 using {control down, option down}
end if
if SpaceNum is "12" then
	delay 0.1
	tell application "System Events" to key code 19 using {control down, option down}
end if
if SpaceNum is "13" then
	delay 0.1
	tell application "System Events" to key code 20 using {control down, option down}
end if
if SpaceNum is "14" then
	delay 0.1
	tell application "System Events" to key code 21 using {control down, option down}
end if
if SpaceNum is "15" then
	delay 0.1
	tell application "System Events" to key code 23 using {control down, option down}
end if
if SpaceNum is "16" then
	delay 0.1
	tell application "System Events" to key code 22 using {control down, option down}
end if

unless I miss something, this can't do what the "Only Move Window, Do NOT Switch To Space" option did. It moved a window to a different space without actually switching to that space. (Unfortunately Apple blocked that on current macOS)

The standard move window to space actions should still work in BTT.

Thanks for the info Andreas! It's sad Apple blocks stuff like this :confused:
And sorry for the slow response to your quick one :pray:

Cool that you shared this workaround (even though if it's not as fast as what we had before, and may trigger automations on the way). Thanks!