I would like to add a link to a bookmark to its page programatically.
There are 2 ways to go to a page of a bookmark clicking the bookmark.
If I go to bookmark properties I can see the actions, go to a page in the document by page number or a named location.
I can create a bookmark and name it and I can set the setAction, I can use an own script.
I was looking for a way to add a named location to a bookmark but there isn't any property to do it programatically.
I can use the method gotoNamedDest but I don't know how to set the named location to a page.
// Open a new document
var myNovelDoc = app.openDoc("/c/fiction/myNovel.pdf");
// Go to a destination in this new doc
// Close the old document
I saw that I can use openDoc but it is for external documents that disclosed property is set to true and are needed security privileges.
I can add a setPageLabels to a page but I dont know how to go to this page when the bookmark is clicked, programatically.
I would like to know to do it with a command to follow the pagelabel when I click a bookmark if is posible.
Sure there is way to do it easily, without security privileges.
You can't add a named location to a document using a script.
You can't even get the names of all the named destinations in a document
using a script.
You can only go to a named destination, provided you supply the name.
Otherwise I' ve just found the way to do it by page number.