Yep, like Laurens said, use the data from the HTML setup sheet:
define a two new variables:
var toolRenderer;
var exportedTools = {};
in onOpen add:
toolRenderer = createToolRenderer();
toolRenderer.setBackgroundColor(new Color(1, 1, 1));
toolRenderer.setFluteColor(new Color(40.0/255, 40.0/255, 40.0/255));
toolRenderer.setShoulderColor(new Color(80.0/255, 80.0/255, 80.0/255));
toolRenderer.setShaftColor(new Color(80.0/255, 80.0/255, 80.0/255));
toolRenderer.setHolderColor(new Color(40.0/255, 40.0/255, 40.0/255));
in onSectionEnd add:
var id = tool.number;
var path = "tool" + id + ".png";
var width = 2.5 * 100;
var height = 2.5 * 133;
try {
if (!exportedTools[id]) {
toolRenderer.exportAs(path, "image/png", tool, width, height);
exportedTools[id] = true; // do not export twice
}
} catch(e) {
// ignore
}
Once you have this inserted, you should get the tool image in the same folder as the setup sheet. I use excel VBA to pull the images in and place them usually