Copy link to clipboard
Copied
I have a JavaScript that exports each page in the document as a separate PDF file. I would like to do the same thing, but with a script that just exports pages that are selected in the Pages panel. Is there a way to tell which pages are selected in the Pages panel? Thanks in advance.
-Rick
I asked a similar question here: Get information about Panels in Javascript
The answer, from @Harbs, was no. You could make your own dialog to let users choose pages, but it doesn't appear to be possible to integrate with the existing panel in that way.
Copy link to clipboard
Copied
I asked a similar question here: Get information about Panels in Javascript
The answer, from @Harbs, was no. You could make your own dialog to let users choose pages, but it doesn't appear to be possible to integrate with the existing panel in that way.
Copy link to clipboard
Copied
Hi Rick,
I want to resurrect this old thread, because I found a trick to gain the information what document pages are selected in the Pages panel.
Perfectly—I think—for InDesign CS6 (selected master pages or selected document pages):
4. Re: active page vs selected page
Uwe Laubender Jan 13, 2017
Re: active page vs selected page
Not so for InDesign CC and above.
With newer versions I could only detect the selected document pages and the master spreads (not the individual master pages) that are selected in the Pages panel:
6. Re: active page vs selected page
Uwe Laubender Jan 15, 2017
Re: active page vs selected page
Please test and give feedback in the thread where I published the code.
Thanks,
Uwe
Copy link to clipboard
Copied
I found something by mistake, but I have no time to investigate further:
app.panels.item('Pages') returns the "Pages Panel"
More importantly that pages panel can be the parent of an Event, so I'm guessing we can attach a "afterSelectionChanged" event listener to it.
Copy link to clipboard
Copied
Hi Vamitul,
yes, accessing the pages panel and making it visible is easy—if you follow the links in my last post you can see this in my function getSelectedPagesInPagesPanel():
app.panels.itemByName("$ID/Pages").visible = true;
A bit shorter, but basically the same:
app.panels.item("$ID/Pages").visible = true;
FWIW: This one here would not work with my German InDesign:
app.panels.item("Pages").visible = true;
Then we could do something with it. E.g. invoking one of its menu by its associatedMenuAction if available.
The one we had for a brief time with InDesign CS6 was perfect: "$ID/kOptionalPageMenuItem"
It could be applied to user selected master pages or user selected document pages in the Pages panel.
Could you explain how the Pages panel can be the parent of an event?
I always see the LayoutWindow window as the parent if I am working with "afterSelectionChanged".
Even if I select pages with method select().
Thanks,
Uwe