JavaScript - Select children bookmarks if I selected parent

Forum for the PDF-XChange Editor - Free and Licensed Versions

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

Loki@99
User
Posts: 558
Joined: Sat Dec 16, 2023 11:09 am

JavaScript - Select children bookmarks if I selected parent

Post by Loki@99 »

Hi,

Is there a JavaScript which can select children bookmarks if I selected parent ?

My main purpose is to be able to bulk rename children (add prefix or suffix) with JavaScript after that action.

Thank you,
Major Stylus topics
- RemoveAnnotationsWithEraser T#6903
- MiniPopupMenuOnTextSelection T#6894
- AbnormalSpikes forum.pdf-xchange.com/viewtopic.php?p=179935&hilit=spikes#p179935
- ForceEraserPreview forum.pdf-xchange.com/viewtopic.php?t=42380
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19868
Joined: Mon Jan 12, 2009 8:07 am

Re: JavaScript - Select children bookmarks if I selected parent

Post by Stefan - PDF-XChange »

Hello Loki@99,

What JS can do with bookmarks is quite limited and those are the only 4 methods available:
image.png
So there is no way really for you to achieve such a selection.

Can you please share with me the use case where you would need such a selection done via JS?

Kind regards,
Stefan
You do not have the required permissions to view the files attached to this post.
Loki@99
User
Posts: 558
Joined: Sat Dec 16, 2023 11:09 am

Re: JavaScript - Select children bookmarks if I selected parent

Post by Loki@99 »

Hi Stefan,
Tracker Supp-Stefan wrote: Tue Oct 01, 2024 10:32 am Can you please share with me the use case where you would need such a selection done via JS?
My user scenario is that I have this file for e.g
File_sample.pdf

All Level 1 bookmarks are the answers of the clinical cases.

image.png

What I would like to do with JS is
1. Select children bookmarks after selecting parent bookmark with a drag to select action. It's a lot more than 4 clinical cases.
2. Bulk add "Answers - " as prefix to all selected bookmarks from step 1 i.e the children
You do not have the required permissions to view the files attached to this post.
Major Stylus topics
- RemoveAnnotationsWithEraser T#6903
- MiniPopupMenuOnTextSelection T#6894
- AbnormalSpikes forum.pdf-xchange.com/viewtopic.php?p=179935&hilit=spikes#p179935
- ForceEraserPreview forum.pdf-xchange.com/viewtopic.php?t=42380
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19868
Joined: Mon Jan 12, 2009 8:07 am

Re: JavaScript - Select children bookmarks if I selected parent

Post by Stefan - PDF-XChange »

Hello Loki@99,

Thanks for clarifying, however I am afraid there is no automated way I can think of that would achieve the desired selection, sorry!

Kind regards,
Stefan