Well the beauty of code based UIs are that you can do stuff like this with loops (and I would really refrain from autogenerating Javascript code that creates 512 buttons manually).
Take a look at this quick example:
Content.makeFrontInterface(400, 300);
const var buttons = [];
var x = 0;
var y = 0;
const var Panel = Content.addPanel("Panel", 10, 10);// [JSON Panel]
Content.setPropertiesFromJSON("Panel", {
"width": 510,
"height": 255
});
// [/JSON Panel]
for(i = 0; i < 64; i++)
{
x = parseInt(i % 8);
y = parseInt(i / 8) * 32;
buttons.insert(-1, Content.addButton("button"+i, x * 64, y ));
buttons[i].set("width", 60);
buttons[i].set("text", x+1);
buttons[i].set("parentComponent", "Panel");
}
The panel acts as parent component, so the positions of the buttons are set relatively to the Panel. You can select the panel and move it around and the buttons should follow (make sure you select the panel by rightclicking and choose "Select Component to Edit -> Panel"
If you planning to build sequencers or any kind of matrix (which your power of two number suggests), this is really the recommended way.