The description of 'pageString' contains this (my emphasis):
> The page(s) to export, specified as a page number or an array of page numbers. Note: Valid when JPEG export range is not all.
Since you don't set jpegExportRange anywhere above it in your script, it probably takes the last value -- and probably this is not ExportRangeOrAllPages.EXPORT_RANGE.
In line 3 there is
exportRangeOrAllPages = ExportRangeOrAllPages.exportRange.
I think this sets the export range so to "not all". What I don't find is a way to set a value to exportRange other than the enumerator.
Apologies, I missed that! But the symptoms clearly indicate something related is wrong ...
After some fruitless trying, the proverbial apple dropped.
That property is not called "exportRangeOrAllPages" ... See JPEGExportPreference: jpegExportRange.
And another thing: "JPEGColorSpace", two lines below, is also wrong.
Many thanks Muppet Mark! Works beautifully.