Hi,
I’m trying to use TotalSpaces.window_list() as shown in the [documentation][1] and I’m getting an unexpected error:
% ./testTotalSpaces.rb
/Library/Ruby/Gems/1.8/gems/totalspaces-0.3/lib/totalspaces.rb:346:in `window_list': undefined method `force_encoding' for "/Volumes/xxxxx/Users/xxxxx/Downloads/2013-08-17":String (NoMethodError)
from /Library/Ruby/Gems/1.8/gems/totalspaces-0.3/lib/totalspaces.rb:342:in `each'
from /Library/Ruby/Gems/1.8/gems/totalspaces-0.3/lib/totalspaces.rb:342:in `window_list'
from /Library/Ruby/Gems/1.8/gems/totalspaces-0.3/lib/totalspaces.rb:337:in `each'
from /Library/Ruby/Gems/1.8/gems/totalspaces-0.3/lib/totalspaces.rb:337:in `window_list'
from ./testTotalSpaces.rb:6
Here’s my script:
#!/usr/bin/env ruby
require 'rubygems'
require 'totalspaces'
windows = TotalSpaces.window_list
if !windows.empty?
current_space_windows = windows[TotalSpaces.current_space - 1]
front_window = current_space_windows[:windows][0]
TotalSpaces.move_window_to_space(front_window[:window_id], TotalSpaces.current_space + 1)
end
The window mentioned in the error message is a Path Finder window.
Is this a bug, or am I missing something?
Thanks,
Philippe
[1]: http://binaryage.github.io/totalspaces-api/ruby/rdoc/TotalSpaces.html “documentation”