Beenden
  • Globale Community
    • Sprache:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티

paragraph --- hyperlink destination

Teilnehmer ,
May 31, 2019 May 31, 2019

How do I check the paragraph has hyperlink destination

THEMEN
Skripterstellung
603
Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines

correct answers 1 richtige Antwort

Fürsprecher , Jul 04, 2019 Jul 04, 2019

Hi priyak7746321​,

I digged a bit got this, you may give it a shot:

var myDoc = app.documents[0];

for(var pg = 0; pg < myDoc.pages.length; pg++){

    for(var tf = 0; tf < myDoc.pages[pg].textFrames.length; tf++){

        for(var p = 0; p < myDoc.pages[pg].textFrames[tf].paragraphs.length; p++){

            if(checkIfDestinationHyerlink(myDoc, myDoc.pages[pg].textFrames[tf].paragraphs

)){

                //Use it as per your need

                $.writeln("Destination hyperlink found in this para----");

  

...
Übersetzen
Teilnehmer ,
May 31, 2019 May 31, 2019

I am going to add hyperlink for text. if the text has existing hyperlink destination how to validate. anyone please advice.

Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines
Fürsprecher ,
Jul 04, 2019 Jul 04, 2019
AKTUELL

Hi priyak7746321​,

I digged a bit got this, you may give it a shot:

var myDoc = app.documents[0];

for(var pg = 0; pg < myDoc.pages.length; pg++){

    for(var tf = 0; tf < myDoc.pages[pg].textFrames.length; tf++){

        for(var p = 0; p < myDoc.pages[pg].textFrames[tf].paragraphs.length; p++){

            if(checkIfDestinationHyerlink(myDoc, myDoc.pages[pg].textFrames[tf].paragraphs

)){

                //Use it as per your need

                $.writeln("Destination hyperlink found in this para----");

                }

            else{

                $.writeln("No Destination hyperlink !");

                }

            }

        }

    }

//

function checkIfDestinationHyerlink(myDoc, myPara){

    for(var hd = 0; hd < myDoc.hyperlinkTextDestinations.length; hd++){

        if(myDoc.hyperlinkTextDestinations[hd].destinationText.paragraphs[0] == myPara){

            return true

            }

        }

    return false;

    }

Best

Sunil

Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines