: InDesign CC javascript and hyperlinks: how do you determine what kind of hyperlink you're dealing with? I am fairly new to scripting, and I'm developing a script that extracts destination URLs
I am fairly new to scripting, and I'm developing a script that extracts destination URLs from all the hyperlinks in a document. Sure enough, there are some cross-references in these documents that are not HyperlinkURLDestination's, so, naturally, my script is bombing when I try to reference the hyperlink's destinationURL.
In another discussion, I thought I had found exactly what I was looking for:
...
if (app.activeDocument.hyperlinks[k].destination instanceof HyperlinkURLDestination)
...
which, in my case, looks like this:
...
if (doc.hyperlinks[i].destination instanceof HyperlinkURLDestination)
...
Now this is where it bombs, and only when it encounters a hyperlink that is not instanceof HyperlinkURLDestination (after 12 HyperlinkURLDestination's, it's the first instanceof HyperlinkTextDestination).
I am clearly doing something wrong. Does anyone have any experience with this kind of scripting in InDesign CC (2017)? Thanks.
More posts by @Jessie844
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.