since you asked in the scripting forum:
Depending on your version of InDesign you can build your own script doing this.
Recently I showed, that it is possible to detect selected pages in the Pages panel by scripting.
For CS6 there is a flawless solution even to detect selected pages of the masters section.
For all other versions of InDesign that support property pageColor it is possible to detect all selected document pages.
Details for the dection mechanism can be found here in the forum.
You can build on that implementing a pre-defined range of selected pages for the PDF export dialog.
2 people found this helpful
Recently I needed the feature you are searching for, but I did’t not find anything doing this. So I created a script that do exactly this action.
This script exports to PDF, JPG or PNG the pages marked with a color label, you can mark with more label and select what you need to export .
You can download it from https://smartmix.it/grafica-design/labeled-pages-exporter-indesign/
Perhaps a more direct approach: Use ScriptUI to build a simple choose-from-list dialog and populate it with the names of the pages in the active document. The user selects pages using click, shift-click or control-click and the export script takes it from there.
exporting pages that are using a disctinct color label? No problem.
But the question of the OP was a bit different:
Can selected pages in the Pages panel be detected for export to PDF?
I answered this with a clear yes.
If you follow the link I gave in answer #1 you can see how this can be done.
With InDesign CS6 this is possible without a trace exploiting the value of optionalPage.
For CC and above we can exploit the value of pageColor.
That will leave traces, that should be made undone.
No worries, I hit reply on the wrong part of the post. I was meaning to reply to smartmix's script submission as I'd seen loic posting progress of his color page percentage script on twitter.
I use color label because it is a selection you can't loose. When I wrote this script I was editing a big file with a lot of pages, I needed to mark and export the modify pages without forgot them. I think it can be helpul even it does't answer the exact question: you can select the pages you need, apply a label and export.
No question. Your script is very helpful… :-)
Just wanted to steer the discussion back to its origin: Selected pages.