The API move_window_to_space is too ordinary,I mean it's so convenient, but not beautiful..... ;

It is so convenient to move window to other space with this API

But, I think it is too ordinary,yes, I mean it’s not beautiful… :wink: ;

Dear Stephen,
Could you give us an amazed API, just like: A animation when the window moving to other space,
for ex: slide window over other space

share my script , I use Alfred APP to run this script when press the hotkey F1

#!/usr/bin/ruby
require 'totalspaces2’
current_space = TotalSpaces2.current_space
windows = TotalSpaces2.window_list
case current_space
when 1
dest_space = 2
when 2
dest_space = 1
when 3
dest_space = 4
when 4
dest_space = 3
else
end
if !windows.empty?
current_space_windows = windows.select {
|window| window[:space_number] == current_space
}
if current_space_windows[1]
TotalSpaces2.move_window_to_space(
current_space_windows[0][:window_id], dest_space
)
TotalSpaces2.set_front_window(current_space_windows[1][:window_id])
elsif current_space_windows[0]
TotalSpaces2.move_window_to_space(
current_space_windows[0][:window_id], dest_space
)
end
end

Dear Stephen …

Oh hi… I’m sorry I somehow missed your request.

I suppose there could be an API like move_window_and_change_to_space that would do the same as when you move a window with the hotkey. Is that what you wish for?

No, I just want to move windows to other space without switching space at the same time;

for example: A message received when I am writing email, and I need to reply this message right now,
and then I would throw away the msg window to other window after done this;

                It's COOL?

I wanna animation when the window moving to other space but not disappeared immediately when I press hotkey;

I wish the window sliding to other space when I press hotkey “F1”

#!/usr/bin/ruby
require ‘totalspaces2’

current_space = TotalSpaces2.current_space
windows = TotalSpaces2.window_list
if current_space < 4
dest_space = current_space + 1
else
dest_space = 1
end

if !windows.empty?
current_space_windows = windows.select {
|window| window[:space_number] == current_space
}
if current_space_windows[0]
TotalSpaces2.move_window_to_space(
current_space_windows[0][:window_id], dest_space)
if current_space_windows[1]
TotalSpaces2.set_front_window(current_space_windows[1][:window_id])
end
end
end

Ok, that’s clear, thanks. I will think about it. Possibly the API could offer control of the position of the window, so you could do whatever animation you want yourself.

Oh,haha,Thank you!
Could you give me a beta version ASAP, I could not wait to test the feature!

And I will parade this perfect feature to my friends!

Dear Stephen,I am so sorry for bothering you every few days, but I think I can not wait, I am a fanatic fans of TS!

I’ll add it when I can, be a little patient! :slight_smile:

My Dear Stephen!!!!!!!!!!!!!

Sorry, busy with other priorities. I will get to your API change, please wait a little.

:smile:,TKS very much!

Could I try it before the new year?

Definitely before Chinese new year :slight_smile:

Oh, it’s a long time! I need a surprise gift

require ‘totalspaces2’

current_spaces = TotalSpaces2.current_space
windows = TotalSpaces2.window_list
if current_spaces < 4
dest_space = current_spaces + 1
else
dest_space = 1
end

if !windows.empty?
current_space_windows = windows.select {
|window| window[:space_number] == current_spaces
}
end

if current_space_windows[0]
win_pra = (current_space_windows[0][:frame].delete"{} ").split(’,’)
xpos = win_pra[0].to_i
ypos = win_pra[1].to_i
off = (1920 - win_pra[0].to_i)
0.step(off,10){|n| TotalSpaces2.move_window(
current_space_windows[0][:window_id],xpos+n,ypos)
}
TotalSpaces2.move_window_to_space(
current_space_windows[0][:window_id],dest_space)
if current_space_windows[1]
TotalSpaces2.set_front_window(current_space_windows[1][:window_id])
end
2.times{TotalSpaces2.move_window(
current_space_windows[0][:window_id],xpos, ypos)}
end