• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

[JS] Recovering invalid hyperlinks/Recuperation des hyperlinks non valide

Enthusiast ,
Dec 03, 2020 Dec 03, 2020

Copy link to clipboard

Copied

Good morning all,

Is it possible with an order to return all the hyperlinks at once without having to test them all?

thank you

Philou

/--------------------------

Bonjour à tous,

Est-il possible avec une commande de retourné tous les Hyperlinks en un seul fois sans devoir tous les tester ?

Merci à vous

Philou

TOPICS
Scripting

Views

161

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Dec 03, 2020 Dec 03, 2020

Copy link to clipboard

Copied

After some research, I can't test the "Status", the status of the Hyperlink !! Can anyone put me on a lead.

/-----

Après des recherches, je ne parvien pas à tester le "Etat" de l'HyperLien  !! Quelqu'un peut-il me mettre sur une piste.

 

Capture d’écran 2020-12-03 à 11.05.24.png

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Dec 03, 2020 Dec 03, 2020

Copy link to clipboard

Copied

I try to rename the HyperLink, but I have already existing name and I catch a VSCode error I can not find an explanation here

“(#15)Cannot execute script in target engine 'main'!”

is my code:

/--------------------

je cherche a renonmer les HyperLink, mais j'ai des nom déjà existant et j'attrape une erreur de VSCode «(#15)Cannot execute script in target engine 'main'!», je ne trouve pas d'explication 

 

voici mon code:

 

/*-------------------------------------------------------------
     Script pour mettre les destination dans le non de l'HyperLink
     
    
    
    
    
    --------------------------------------------------------------*/
    var scriptName = "Hyper_reName";
    $.writeln("Début du script ("+scriptName+"): " + logHeure () );
    // Affichage de toute les Ancre
    // fermetute de la fenêtre des ancre 
    try {

        app.panels.item('$ID/Hyperlinks').visible = false;
    
      } catch (_) {
    
      }

//-----------------------------------
// variabnle general

  var leDoc = app.activeDocument;
  var scriptName = "HyperLien";
  
//-----------------------------------



$.writeln(leDoc.hyperlinks.count());
$.writeln(leDoc.hyperlinks.length);


var leTotale = leDoc.hyperlinks.count();
for (var i = 0; i < leTotale; i++) {
    
    try {
      leDoc.hyperlinks[i].name = leDoc.hyperlinks[i].destination.name; // problème de titre identique retrava
      // backup       leDoc.hyperlinks[i].name = leDoc.hyperlinks[i].destination.destinationURL; // problème de titre identique retrava

    }
    catch(e) {
        //$.writeln('erreur Ancre. ' + e)
       leDoc.hyperlinks[i].name = leDoc.hyperlinks[i].destination.name + '_' + i;
              // backup eDoc.hyperlinks[i].name = leDoc.hyperlinks[i].destination.destinationURL + '_' + i;

    }

}

$.writeln("Fins du script ("+scriptName+"): " + logHeure () );



function logHeure () {
  // Recupération de l'heure pour le Log. 
      var ladate=new Date();
      var h = ladate.getHours();
      var m = ladate.getMinutes();
      var s = ladate.getSeconds();
      var mi = ladate.getMilliseconds();
          return (" "+ ((h<10) ?  "0" + h : h) +":"+ ((m<10) ?  "0" + m : m )+":"+ ((s<10) ? "0" + s : s)+":"+ ((s<100) ? "0" + mi : mi));
}

 

I would like to photo1 to photo2

/----

Je voudrai à la photo1 à la photo2

 

Capture d’écran 2020-12-03 à 12.38.07.png

 

Capture d’écran 2020-12-03 à 12.41.17.png

 

Merci

 

Philou

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 03, 2020 Dec 03, 2020

Copy link to clipboard

Copied

Hi Philou,

what is the destination of that broken hyperlink?

 

Regards,
Uwe Laubender

( ACP )

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Dec 03, 2020 Dec 03, 2020

Copy link to clipboard

Copied

LATEST

Hello Laurender,

These are URLs (hyperlinkURLDestinations), some address is not good.

 

thank you

 

Bonjour Laurender,

Ce sont des URL (hyperlinkURLDestinations), quelque adresse ne sont pas bonne.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines