Many thanks in advance!
Notice that you call exportFile() method with some target.
An object (group) can be a target as well.
uses a target set in preferences (page range or all pages)
has target set already to a textFrame.