A sample of what's possible when you combine Javascript with InDesign: a Maze generator.
I set out to find a Javascript that created mazes for HTML websites, but, while there are tons of those, they were not as easily converted to InDesign as I hoped. So I wrote one of my own using a description of Maze Generators on http://www.astrolog.org/labyrnth/maze.htm, but the code is entirely my own.
Not yet satisfied, I changed it from the usual rectangular shape to fill any object you care to draw! With this one constraint: curved edges are converted rather bluntly into straight lines. It won't work on a circle, for example (this will be 'straightened' into a rectangle), but it will work on, for example, a 5 pointed star!
Each small rectangle is about 5 mm wide and high, so make sure your object is large enough.
Download the code from my website: http://www.jongware.com/binaries/mazes-everywhere.zip
Start it in a blank document with no selection to get a crude "width/height" dialog, or draw a rectangle and have it selected to fill it with 5 mm wide maze paths. If you're feeling experimentally, draw polygons, or tack together a few shapes and combine their paths into one.
And if you're feeling really courageous, experiment with how to get 'holes' in your maze!
This one started out as Arial Black text, tracked to join the letters together; then it took some tries to get the "winding" of the holes right. (Techno-babble: There seems to be a bug in my code that doesn't always seems to return the correct winding order.)
Have fun!