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

Retune conditional text (visible = false)

Enthusiast ,
Apr 29, 2019 Apr 29, 2019

Hello everyone, it's been a long time.

Is it possible to return the non-visible conditional text? with the search it is not possible.
I try to make a list with the texts cache but they must absolutely not move the text.
A beginning of track, commende for me to start the script, thank you

Philou

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

Bonjour à tous, cela fait très long temps.

Est-il possible de retourné le texte conditionnel non visible? avec la rechercher c'est pas possible.

Je cherche a faire une liste avec les textes cache mais ils ne doivent absolument pas faire bouger le texte.

Un début de piste, de commende pour moi commencer le script, merci

Philou

TOPICS
Scripting
1.3K
Translate
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 ,
Apr 29, 2019 Apr 29, 2019

Hi Philou,

yes, that's possible.

Look for hiddenTexts in a Story, TextFrame, Footnote, Cell or even Note object.

Just a sample.

Hide some conditional text in a text frame.

Select the text frame.

Get the contents of the all hidden texts of the story of the text frame:

app.selection[0].parentStory.hiddenTexts.everyItem().texts.everyItem().contents

Regards,
Uwe

Translate
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 ,
Apr 30, 2019 Apr 30, 2019

Hello/Bonjour Laubender​,


Thank you for your reply.

   

   $.writeln('Selection : ' + app.selection[0].hiddenTexts.everyItem().texts.everyItem().contents); 


I used the code on a selection, it returns me well hidden texts, is it possible to find what is the name of the condition? and find the page number of the hidden text?

My parents use is not very good !!

$.writeln('le Parent : ' + app.selection[0].hiddenTexts[1].parent.constructor.name);

My final goal is to create a list style with the different texts chaché with their pagination.


Thanks for the continuation ...

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

Merci pour votre réponse.

   $.writeln('Selection : ' + app.selection[0].hiddenTexts.everyItem().texts.everyItem().contents); 

J'ai utilisé le code sur une sélection, il me retourne bien les textes caché, est-il possible de retrouvé  quel est  le nom de la condition? et de trouv" le numero de page du texte caché?

Mon utilisation des parents n'est pas très au point !!

$.writeln('le Parent : ' + app.selection[0].hiddenTexts[1].parent.constructor.name);

Mon but final est de crée un style liste reprenant les différent textes chaché avec leur pagination.

Merci pour la suite ...

Translate
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 ,
Apr 30, 2019 Apr 30, 2019

For the page I use this which seems to me function (to test more deeply)

Pour la page j'ai utilise ceci qui me semble fonction ( à test plus en profondeur)

$.writeln('\rle text hiddenTexts[1]: ' + app.selection[0].hiddenTexts[1].storyOffset.parentTextFrames[0].parentPage.name + '\r\r');

Translate
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 ,
Apr 30, 2019 Apr 30, 2019

Hi,

just wanted to post nearly the same.

Since hiddenText.storyOffset is the insertion point just before the hidden text starts it is save to fetch the parent text frame.

Unless the storyOffset is in overset text.

FWIW: parentPage can also return null if parent text frame in on the pasteboard.

To see which hidden text belongs to which condition:

1. You could store hiddenText.texts in an array.

2. Then you could change a specific condition.visible from false to true.

3. Do a Find GREP on the specific condition and compare the found texts with the texts of your array.

Just a suggestion. Not tested.

Regards,
Uwe

Translate
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 ,
Apr 30, 2019 Apr 30, 2019

Ok thank you, it helps me a lot already.

Ok merci ça m'aide déjà  beaucoup.

Translate
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 ,
Apr 30, 2019 Apr 30, 2019

Laubender  wrote

To see which hidden text belongs to which condition:

...

That is what the appliedCondition array is for!

All text showing -- note the overlapping conditions in the green "Find GREP":

and some hidden:

listing the appliedConditions on each hidden text shows:

"hidden text ": Condition 2
"Find ": Condition 2
"GREP": Condition 2, Condition 3
" ": Condition 2

Translate
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 ,
Apr 30, 2019 Apr 30, 2019

Hi Jongware,

ah! you mean the appliedConditions array of every instance of hiddenText.texts.

As documented here:

Adobe InDesign CS6 (8.0) Object Model JS: Text

Thanks,
Uwe

// EDIT: Added link to DOM documentation appliedConditions array of object Text.

Translate
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 ,
Apr 30, 2019 Apr 30, 2019
LATEST

Merci  [Jongware]​, pour ta contribution

voici mes ligne de test sur le code de condition

var o = {}; // creation d'un protoype Object soit undefined 

var currDoc = app.activeDocument;

   laCreationBloc();

      

       var testLesTextesName = app.selection[0].hiddenTexts[1].storyOffset;

       var testLesTextes1 = app.selection[0].hiddenTexts[1];

     

     

     

      $.writeln('\rle text hiddenTexts[1]: ' + testLesTextes1.texts.everyItem().contents + '\r\r');

   

     $.writeln('\rle text hiddenTexts[1]: ' + app.selection[0].hiddenTexts[1].storyOffset.parentTextFrames[0].parentPage.name + '\r\r');

  

      $.writeln('\rle text hiddenTexts[1]: ' + app.selection[0].hiddenTexts[1].storyOffset.parentTextFrames[0].parentPage.name + '\r\r');

    

    

      var le_textesTrouve = testLesTextes1.texts.everyItem().duplicate(LocationOptions.AT_END, o.leBlocLegendes);

     

     $.writeln(le_textesTrouve[0].constructor.name);

     $.writeln(le_textesTrouve[0].appliedConditions[0]);

     $.writeln(le_textesTrouve[0].appliedConditions[0].name);

     $.writeln(le_textesTrouve[0].appliedConditions[0].visible);

    

     { var p =   le_textesTrouve[0].appliedConditions[0].properties; for (var i in p) $.writeln(i +  "\t"+p); }

       $.writeln(le_textesTrouve[0].applyConditions ( [], true ));

  

    

function laCreationBloc() {

       // creation du bloc

        //en Pausse

       // mettre un Lable pour la mis à jour

       o.leBlocLegendes = app.activeDocument.textFrames.add();

       //        o.leBlocLegendes.geometricBounds = ["197mm", "425mm", "257mm", "509.5mm"];

       o.leBlocLegendes.geometricBounds = ["10mm", "20mm", "40mm", "160mm"];

       //o.leBlocLegendes.contents = o.lesRef[1];

       o.leBlocLegendes.label = "lesLegendes";

       //o.leBlocLegendes.applyObjectStyle( o.objStyle );

    }

Translate
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