some time ago a library is released for indesign named basil.js.
It is inspired by processing, a great java dialect for artists (www.processing.org).
Here is the website about basiljs:
I just thought some people meight want to take a look at it.
Sorry for pushing an old thread. I love the library and am really looking forward to using it much more for my projects. One problem, though, is that it needs to be updated. When I select InDesign CC 2014 in ExtendScript and want to run my basiljs-script, I get a message saying something like it needs Indesign CC to retrieve the Objectmodel data, so it doesn't work in CC 2014 right now.
I wonder if it'd be hard to update it on my own? Maybe there isn't much to change. But I'll ask the developers first, maybe they can do something about it or I'll have to wait for the next update.