7 Replies Latest reply on Mar 31, 2017 8:09 AM by Peter Kahrel

    Check Textframe content

    cmoke73 Level 1


      My „mission“ this time is - shortly explained -  to re-format some tables in a magazine.

      For the case one chose one or more Textframes, there is a condition at the beginning of the script:



      var myDoc = app.documents[0];  
      var myPage = myDoc.pages[0];  
      var allSelection = myDoc.selection;
      var mySelection = allSelection[0];
      var numbSelection = allSelection.length;
      for (var i=0; i < numbSelection; i++) {
          if (allSelection[i].constructor.name != "TextFrame") {
              alert("Bitte wähle einen Textrahmen aus! " + allSelection[i] + " ist KEIN Textrahmen!");
          else if (allSelection[i].contents.constructor.name != "Table") {
              alert("Der Textrahmen benhaltet keine Tabelle!");
          else {alert("Die Show kann beginnen!")};


      All I want to know now is, where is my fault (line 13.)? I want to check if there is a table inside.