Select specific frames script

Is there a way to select specific frames via lua script rather than having to hold control and click frames individually prior to exporting a sprite sheet variation?