6 Replies Latest reply on Jun 14, 2018 3:47 AM by Laubender

    Set all text frame object style to [None]?

    neal derekl34934377 Level 1

      Attempting to add a line of code to the below jsx to apply “none” to all text frames within a document, while not affecting their present styling.

       

      The below resulted in “None” in the Extend Script console (also tried “[None]”), but doesn’t affect Indesign text frames whatsoever.

       

      Also tried searching the Jongware index to no avail.

       

       

      Thanks for any leads on this matter.

       

      Cheers.

       

       

       

       

      var doc = app.documents[0];  
      var allTextContainers = [];  
      var allStories = doc.stories.everyItem().getElements();  
      var allStoriesLength = allStories.length;  
        
      for(var n=0;n<allStoriesLength;n++)  
      {  
          allTextContainers = allTextContainers.concat( allStories[n].textContainers );  
      };  
        
        
      var allTextContainersLength = allTextContainers.length;  
        
      for(var n=0;n<allTextContainersLength;n++)  
      {  
          if( allTextContainers[n].constructor.name == "TextPath" ){ continue };  
        
          allTextContainers[n].textFramePreferences.autoSizingType = AutoSizingTypeEnum.OFF;  
      allTextContainers[n].textFramePreferences.useFixedColumnWidth = false;
      
      allTextContainers[n].appliedObjectStyle = "None";
        
      };  
      

       

       

       

       

      Syntax needed to set all txt frame object styles to [None].

      Screen Shot 2018-06-08 at 10.42.24.png