# API for TS2, please

**URL:** <https://discuss.binaryage.com/t/api-for-ts2-please/670>\
**Category:** TotalSpaces\
**Created:** [October 28, 2013, 4:26am UTC](https://discuss.binaryage.com/t/api-for-ts2-please/670 "2013-10-28T04:26:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bob](https://discuss.binaryage.com/letter_avatar_proxy/v4/letter/b/ea666f/32.png) [@bob](https://discuss.binaryage.com/u/bob)\
**Post date:** [October 28, 2013, 4:26am UTC](https://discuss.binaryage.com/t/api-for-ts2-please/670/1 "2013-10-28T04:26:28Z")

</div>

Thanks so much for the immense amount of work that must have been required for TotalSpaces 2. Although I’m glad to learn that the TS2 API is forthcoming, the API is the main reason I bought TS in the first place. Specifically, I need:

TotalSpaces.on\_space\_change  
TotalSpaces.name\_for\_space  
TotalSpaces.window\_list

I appreciate the free upgrade from TS1, but if paying for the upgrade to TS2 would result in the TS2 API sooner, that would be fine with me!

Best,  
Bob

---

<div class="post-metadata">

**Author:** ![stephen](https://discuss.binaryage.com/user_avatar/discuss.binaryage.com/stephen/32/2286_2.png) [@stephen](https://discuss.binaryage.com/u/stephen)\
**Post date:** [October 28, 2013, 12:21pm UTC](https://discuss.binaryage.com/t/api-for-ts2-please/670/2 "2013-10-28T12:21:56Z")

</div>

The API needed an overhaul because of the ability for different grids to be on different displays.

I understand you need the api - I’ll get to it asap.

---

<div class="post-metadata">

**Author:** ![FlipMartin](https://discuss.binaryage.com/user_avatar/discuss.binaryage.com/flipmartin/32/511_2.png) [@FlipMartin](https://discuss.binaryage.com/u/FlipMartin)\
**Post date:** [October 29, 2013, 1:19pm UTC](https://discuss.binaryage.com/t/api-for-ts2-please/670/3 "2013-10-29T13:19:48Z")

</div>

👍 Looking forward to it too!

---

<div class="post-metadata">

**Author:** ![stephen](https://discuss.binaryage.com/user_avatar/discuss.binaryage.com/stephen/32/2286_2.png) [@stephen](https://discuss.binaryage.com/u/stephen)\
**Post date:** [February 17, 2014, 9:06am UTC](https://discuss.binaryage.com/t/api-for-ts2-please/670/4 "2014-02-17T09:06:07Z")

</div>

Just to follow up, the current pre-release version of TotalSpaces2 supports the API.

> **[binaryage/totalspaces2-api](https://github.com/binaryage/totalspaces2-api/tree/master/ruby)**
>
> API bindings to enable you to get information from and to control TotalSpaces2 - binaryage/totalspaces2-api

---

<div class="post-metadata">

**Author:** ![bob](https://discuss.binaryage.com/letter_avatar_proxy/v4/letter/b/ea666f/32.png) [@bob](https://discuss.binaryage.com/u/bob)\
**Post date:** [February 17, 2014, 11:36am UTC](https://discuss.binaryage.com/t/api-for-ts2-please/670/5 "2014-02-17T11:36:05Z")

</div>

I thought I just upgraded both my TS2 and the api ruby gem, but my ruby script doesn’t work, apparently because I (still?) have different versions:

$ date  
Mon Feb 17 05:22:06 CST 2014  
$ echo $SHELL  
/bin/bash  
$ ruby -e 'require “totalspaces”; puts TotalSpaces.api\_version;'  
2.0.0  
$ ruby -e 'require “totalspaces”; puts TotalSpaces.lib\_total\_spaces\_version;'  
1.0  
$ # The “About” menu selection shows: “TotalSpaces2 v2.1.0 (Mavericks)”  
$ # [http://binaryage.github.io/totalspaces2-api/ruby/rdoc/TotalSpaces2.html](http://binaryage.github.io/totalspaces2-api/ruby/rdoc/TotalSpaces2.html) says the two versions should agree.

Sorry, what am I missing?

Bob

---

<div class="post-metadata">

**Author:** ![stephen](https://discuss.binaryage.com/user_avatar/discuss.binaryage.com/stephen/32/2286_2.png) [@stephen](https://discuss.binaryage.com/u/stephen)\
**Post date:** [February 17, 2014, 1:28pm UTC](https://discuss.binaryage.com/t/api-for-ts2-please/670/6 "2014-02-17T13:28:57Z")

</div>

Hi bob… Sorry there may be some error in my documentation, I’ll check later when I am in front of my computer. But at least you should require ‘totalspaces2’ rather than totalspaces.

---

<div class="post-metadata">

**Author:** ![bob](https://discuss.binaryage.com/letter_avatar_proxy/v4/letter/b/ea666f/32.png) [@bob](https://discuss.binaryage.com/u/bob)\
**Post date:** [February 17, 2014, 1:52pm UTC](https://discuss.binaryage.com/t/api-for-ts2-please/670/7 "2014-02-17T13:52:02Z")

</div>

Yay! That fixed it: totalspaces -\> totalspaces2

Thanks/sorry, I should have seen that. My script works again!
