This may do what you want. Copy this code into a blank text file, then give it the extension JSFL.
// export selected layers of current timeline to image sequence
function main() {
var dom = fl.getDocumentDOM();
if (!dom) {
alert("ERROR: No document available.");
return;
}
var tl = dom.getTimeline();
if (!tl) {
alert("ERROR: No timeline selected.");
return;
}
var layers = tl.layers;
var sel = tl.getSelectedLayers();
var len = layers.length;
var vis = [];
var t = 0;
var i, type;
// hide all but selected layers
for (i = 0; i < len; i++) {
type = layers.layerType;
vis.push(layers.visible);
if (i == sel) {
t++;
}
else if (type == "normal" || type == "guided" || type == "masked") {
layers.visible = false;
}
}
// export timeline
dom.exportPNG("", false, false);
// restore initial state
for (i = 0; i < len; i++) {
layers.visible = vis;
}
}
main();
Then double-click the JSFL file to run it against the current Animate document. Or to have it appear under the Commands menu, copy it into:
%LOCALAPPDATA%\Adobe\Animate CC 2017\en_US\Configuration\Commands