3 Replies Latest reply on Mar 3, 2013 9:45 PM by pixxxel schubser

    selecting all text frames on all visible layers

    DuanesSearchForKnowledge Level 1

      I want to select all text frames on all visible layers.

       

      the script below will select all text frames even in groups but when a layer with text on it is invisible the script will error.(target layer cannot be modified)

       

      if (app.documents.length > 0 ) {

          var doc = app.activeDocument;

          var numTextFrames = 0;

          for (  i = 0; i < doc.textFrames.length; i++ ) {

              textArtRange = doc.textFrames[i];

              textArtRange.selected = true;

                      }

                  }

       

      So I made this script to select text frames on only the visible layers but it now misses text that is in a group.

       

      var layerCount = activeDocument.layers.length;

      var docSelected = activeDocument.selection;

      for (i = 0; i < layerCount; i++)

      {

      currentLayer = activeDocument.layers[i];

      if (currentLayer.visible == visible )

      {

           for (  j = 0; j < currentLayer.textFrames.length; j++ ) {

              textArtRange = currentLayer.textFrames[j];

              textArtRange.selected = true;

            }

        }

      }

       

      can anyone tell me why it does not selected textframes in a group when done this way and is there a way to get all textframes selected on all visible layers?

       

      Thanks,

      Duane