erase empty text frames in the document

I have several blocks of empty text in my documents. I want to erase them with a script.

I have try this script but it returns an error sometimes "delete..." "not an object".

this: (it's BAD CODE DO NOT COPY).

{
app.findGrepPreferences = app.changeGrepPreferences = null;

app.findGrepPreferences.findWhat = "\\A\\Z";

var blocsvides = app.activeDocument.findGrep (true);

for (var i = 0; i < blocsvides.length; i ++)

blocsvides [i] .parentTextFrames [0]. Remove() / / <-in this line, there is an error

}

There are a lot of images in my documents, image, text, and the indefinite object with color too.

Thanks for helping me. :-)

Julien.

This should leave visible frames:

var noColor = app.documents[0].swatches.item(0);
var stories = app.documents[0].stories.everyItem().getElements();
for(var i=0;i 0){continue}
      c.remove();
    }
  }
}

Tags: InDesign

Similar Questions

  • Find block of text frames in the document

    Hi all

    I created the 30 page document, it contains the two frames of threaded related texts and No threaded frames of related texts. I have to write script tool to find UN threaded text frames and anchor to the next to go down with the content frame.

    Any help will be greatly appreciated.

    Thanks in advance

    Hello

    I don't know what specific solution can be found using ID 2014 CC features in the user interface, but a generic way might be to create a function and call it for each page of a doc. The function would be:

    • collect all pageItems (table)
    • Sort by geometricBounds [0] value (ascending)
    • Browse and:
    1. each active element of time is that a girl textFrame ==> placed his last PointInsertion as a destination
    2. otherwise ==> Miller point in current destination (not sure if original visibleBounds are essential to be copied)

    It assumes that the order of the pageItems can rely on its superior position.

    Jarek

  • CS4 automatically resize the height of the text frame to the baseline of the last line of text

    Hello

    Does anyone know of a script that automatically resizes all the heights of text frame in a document so that the bottom of each text block falls on the baseline of the last line of text in the text block? The image height must be determined by the text appearing and does not effect excess or stories of threads.

    Thank you!!

    Chung

    As text blocks have a property 'lines', lines have a property 'base' and executives have a 'geometricBounds' property, this quickly written javascript should do the trick for a block of selected text:

    app.selection[0].geometricBounds = [app.selection[0].geometricBounds[0],app.selection[0].geometricBounds[1],app.selection[0].lines[app.selection[0].lines.length-1].baseline,app.selection[0].geometricBounds[3]];
    

    (Whaddoyouknow: it can be done in one line)

    So let's loop over all the text blocks in your current document:

    allf = app.activeDocument.textFrames;
    for (f=0; f		   
  • How can I transfer text frames of the legend of the Slide Master view to view the film?

    I am a new user of Captivate.

    I created my own master slides. Many of them have blocks of text. My intention was to have the text frames appear whenever I have created a new slide in the Filmstrip view. Instead, I see just the text that I wrote (Insert text "here") in the background. I can't click and change the text in the view of the Film Strip.

    Could someone help me please? How can I make my text in the view of master frames appear as blocks of text whenever I create a new slide in the Filmstrip mode?

    Thank you.

    Levi

    If you want to "text frames", where the text can be changed in the view of the Film Strip, you must insert placeholders on the master slide. You probably insert text captions.

    Anthony

  • A string of text based on the document

    I'm new to illustrator, how to, I put a text string in a document.

    The snippet Panel is simplistic, and I suspect his fall, new version of the text above the other, so you're probably looking to a bunch of text objects (you probably understood that well).

    To change the text of the existing text, you will need to handle the text to change. I do not recommend hanging from the handles outside a 'session' - there are things that cause handles to change, and the object could be deleted after all. Yet, assumg you have the handle, perhaps to the pulling of the selected art set. Then you should do something like this:

    void SetText (handle AIArtHandle, const ASUnicode * text, int length)
    {

    REF TextRangeRef = 0;

    sAITextFrame-> GetATETextRange(handle, &ref);)

    ATE::ITextRange range (ref);

    first delete it

    range. Remove();

    He prepares

    range. InsertAfter (text, length);

    }

  • Empty picture frame to the commissioning of the installation.

    Hello

    I use the first version of the software Flash Player, so I'm not a beginner.

    But when I started the update, the first regular windows installation image is empty (dark grey, no widget inside)

    I uninstalled fashplayer from my PC. I ran the test on this page web https://helpx.adobe.com/fr/flash-player.html

    Flash Player is not detected. I ran the installation with or without firefox problem upward.

    My setup is Windows XP version 2002 service Pack 3

    Firefox v36

    I'm administrator of my PC, so no access to this problem.

    I'm french, sorry for my English, if something is understandable, let me know, I'll try to be clearer.

    Thank you

    The same issue is mailed several times a day, and so is the answer: use offline installers

  • Under Type menu - Insert a special character - markers - current Page number in the text frame on the Master Page gives the letter A and also a horizontal black line the width of the text box.   This line is not a rule.  Turn on the Wellin gives another l

    Is anyone out there?

    I found the problem.  It was a rule after all.  I didn't the insertion point to the right place.  Everything is OK now.

  • Update table of contents (frame) in the primary anchor text stream?

    I understand that a table of contents of InDesign should sit on its own page or in a separate text frame, so it can be easily maintained and updated.

    Help of InDesign said: "avoid threading the TOC to other blocks of text frame in the document. If you replace the existing table of contents, the whole story will be replaced by the update table of contents. »

    Fine and understand. However, I'm working on a project where I need all the content (from the illustration of the cover of the last line) to sit in the primary sequences of the spread of master - including the table of contents.

    Here's what I've tried: I open the Table of contents dialog, made all the settings and click OK. Clicking on will now create a new text frame with the table of contents, which can be changed by selecting this image by using "Update Table of contents. So far so good.

    I cut this framework and then inserted as a framework anchored in the stream text main, just as I have anchor a table, image, etc.. However, after anchor this TOC frame, I can not more updated by using "update the Table of contents. It is just another framework, not recognized as the table of contents more.

    Is there another way to have a 'live', table being updated content that will float in the primary text flow?

    Thank you.

    Ariel, I think you should give up on e-mail responses - empty again...

    PlainMartin,

    I could make this work in CS6 (and I would consider another version that allows to drag the anchored object rather than cut and paste). Now the SHIFT key and dragging the blue handle in the main story, I could anchor the table of contents, and when the text cursor was in it I could update. Make sure you anchor in a separate paragraph that uses a style that is NOT included in the table of contents, or he'll start on update.

  • My block of text type is not selectable in the document (a line as a dotted border)

    How can I get a text in the document after the implementation of a text frame on the master page?

    On the page of the document, you will need to keep the two keys while you click on the frame away from the master, or use the file > place to put the text inside. The only thing that could stop you from doing what I think is if you locked the framework or it is on a locked layer. Locked frames can be selected by default (and you can change this in the preferences) and nothing on a locked layer is selectable, but it looks like not that's the problem if you can select on the master.

  • Need text box changes to reflect through the document.

    Hi all

    I'm pretty new in InDesign. I was wondering if there's some way to do master text box changes reflect through the whole document used this master page after you move the text boxes on the documents. Is this possible?

    So. Let's say that there is the block of text with the text on the master page. I decided to use this master page on a given document, but I needed to move the block of text with the text in this document. I won't be able to change the master page text?

    Right. Once ignore you it and move on the live page, change the text on the master does not affect the text on the live page.

    If you have the same frame with the same variable text appear in the same place on multiple pages, put that image on a master page is a good way to make your life easier. But if you need the same frame with the same variable text appears upwards in * different * places on many pages, there are more effective ways.

    You don't mention a version. CS3 and CS4 allow variables (Type > text Variables). You can create a custom text variable and insert this variable in your document. Change the definition of the variable and this will change all at once. I think that a custom text variable cannot be more than one line long, but the only limit to the length of the line is the length of the block of text that is.

    For more than one line, you can make your block of text in a separate document, export it to PDF and then place the PDF anywhere in your document. Edit the new document, PDF export and it will change all at once. In CS3 or CS4, you can also directly put your separate Indesign document into your working document. No necessary PDF.

    Ken

  • Muse will not allow a hyperlink in a text frame, unless it's rasterized.  The link does not work. ???

    I am a new Subscriber.  I am just placing of text links in a paragraph.  Preview before or after the loading of the site to a Web site, I get an error message that text of the hyperlink in a text frame requires the pixelation and will not work in a browser.  I have read all the manual information and tutorials and there is no mention of pixelation.  Any help will be greatly appreciated.   I use a PC with windows 7.

    John

    d

    Hi Johngjudy,

    Did you use a system font in the text box. If Yes, then try using a web Form or standard font and it works perfectly.

    Kind regards

    Vivek

  • I can't text IMPORTER in InDesign CC without the Red Cross at the bottom of the text frame.

    Hello, I would like to import a manuscript of several pages, since OpenOffice Mac, in InDesign CC on online tutorials I see that all this is accomplished without problem. The import takes place directly on several pages.

    But when I try, I end up with a single filled text frame, and the small red cross at the bottom of the frame indicating that the text is too long. I do not want to paste the rest of the text with the mouse page-by-page. Can you please help me!

    Certainly it is stupid but I am looking for two days!

    Professional in preferences > text box "smart text reflow" is checked. Or so when you import your text, hold down the SHIFT key: this will create as many pages as necessary.

  • Bookmarks PDF failed, cannot connect text frames

    Using FrameMaker 10 to work, our books get their bookmarks shuffled around when convert us to PDF format. Topics in the section get jostled chapter previous, and topics of the first chapter just get dumped into level 1 with the chapter titles.

    That contain our chapters Bookmarks PDF resulting
    • Chapter 1
      • CH1, 1 topic
      • CH1, heading 2
    • Chapter 2
      • CH2, heading 1
      • CH2, heading 2
    • Chapter 3
      • Ch3, heading 1
      • Ch3, heading 2
    • CH1, 1 topic
    • CH1, heading 2
    • Chapter 1
      • CH2, heading 1
      • CH2, heading 2
    • Chapter 2
      • Ch3, heading 1
      • Ch3, heading 2
    • Chapter 3

    I did some research, and the question above is usually because there are flows of separate text for the title of the chapter and the body of the text. It's true. Our chapter model a left & right page and a title page. The title page has just a stream of text "chapter title."

    I have tried to solve this problem, but immediately ran into a new problem. If I try to connect the text frame of the chapter title for the text block body either on the left or right page, I get the following error message:

    "This connection is not possible.

    You can try to connect two blocks of text which would result in a circular text stream, or you can try to connect to a stream of text of PostScript Code. »

    I looked, and the title of the chapter is not connected to anything I can say. Its text does not work anywhere else, and try to go on Page layout-> disconnect Next/Previous/the two just told me he is not connected to anything. If I look at the properties of the object to one of these blocks of text, none of them are marked as PostScript Code. I am at a loss here.

    Any ideas on how to get bookmarks that come out in the right order? We can repair the bookmarks later in Acrobat, but it is a tedious extra step that we sometimes forget. As far as I know, our model was made before the time of our current team. (none of us are really 'experts' on FrameMaker)

    FM treats the stream in the order they are created. Default FM documents already have a cast in place, in order to add the feed to the chapter title that would put after the first default one. If you try to connect the end at the beginning, i.e. to create a circular flow

    Create a new page master first with areas of text required in a single stream. Use the default text box located on the page when FM adds the new page master (usually you use the right page as your model for the first page) and shrink down to be the chapter title section, then add a new block of text to the page for the rest of the content [you now add this text frame/flow after the first]. After you add the headers and footers on the master page to check that the page layout is now visually the same. Remove the first old master page as a last step.

    You will probably have to remove the chapter title text blocks in other documents before importing the new provisions that FM will leave just these are in place and the new & old frames would end by lying on top of the other. Also copy & paste the chapter titles in the mainflow before the update so you don't lose the content.

    [Note: anyone who created the model was probably less than an 'expert' that you are now]

  • block of text related to the enumeration

    in a single document, there are several built-in text block (object applied style = "myObjSty1")

    I want to write an increasing number

    I tried to write, but does not

    Can you help me with this

    Thanks in advance

    var sNo = 1;
    var doc = app.activeDocument;  
    app.findGrepPreferences = app.changeGrepPreferences = null;  
    app.findGrepPreferences.findWhat = "~a";  
    var found = doc.findGrep();  
    for(var i =found.length-1;i>=0;i--)
    {
    if(found[i].allPageItems[0].appliedObjectStyle == myObjSty1)
    {
         found[i].texts[0].select();
         app.changeGrepPreferences.changeTo = (++sNo);
         app.selection[0].changeGrep();
    }
    }
    

    1. you define the if clause inside the loop for.

    2. you must set each block of text by its index

    3. you need a meter to advance whenever a match is found

    //Object style is named "MyObjectStyle1"
    //It is not nested in an ObjectStyleGroup !!
    var myObjSty1 = app.documents[0].objectStyles.itemByName("MyObjectStyle1");
    
    //Selection is the text frame or some text of the story you want to get the anchored text frames:
    var myStory = app.selection[0].parentStory;
    //Collecting ALL anchored text frames of the story to an array:
    var myAnchoredTextFrames = myStory.textFrames.everyItem().getElements();
    
    //Define a start number:
    var myStartNumber = 1;
    
    //Loop through the array of the text frames anchored:
    for(var n=0;n
    

    Uwe

    PS. : He should really look at more in the basics of JavaScript before you do more work in ExtendScript.

  • Resize the document with Tables

    I use InDesign CS6.

    I have more than 100 documents, with tables. I need to resize my documents 48 p 9 x 65 p 3 to the new small size 44 d 3 x 54 p 0.

    When resizing the document is it possible that tables will be will resize automatically also?

    New page in same proportions not same size of the original page size. So can not just scale the page more small.

    But you can scale a table if you to scale the block of text that appear in the table. Make the text frame exactly the same size as the table. Then hold down the Cmd/CTRL + SHIFT and scale the text block to a corner.

Maybe you are looking for

  • Satellite U500-115 - unknown devices after the Installation of Win XP

    Hello I just installed Windows XP on a Satellite U500 - 115 (PSU5EE) and cannot get rid of several unknown devices in Device Manager. Before to install the operating system, I changed settings AHCI in the BIOS to Compatibility-Mode (IDE), so I don't

  • I renew the DHCP on my Airport Express Extender several times a day.

    I have a time Capsule airport connected to an ATT Uverse router mode bridge as my wifi router.  I have Airport Express 6 throughout the House using wifi Extender.  I have to renew the DHCP lease on a large number of Extenders several times a day to k

  • HP650 Notebook: PCI Driver for HP650

    Hello world. Total system reinstallation, managed to reinstall nearly all of the drivers. But both are in particular gives me a headache, the PCI device will be not simply update its driver. Someone point me in the direction of what I'm looking for.

  • Switch default behavior - PXI2503

    Good afternoon I have a few questions about the behavior of my 2503 PXI switch module.   When I close a relay on my switch I hear the click predicted.   Therefore, it leads me to think that something in the breast could wear out over time... I want t

  • How can I find out what products are included on my SN LabVIEW?

    I found a serial number of LabVIEW for Version 8.6 (3rd quarter 2008) in the virtual library of the former employee.  I also have the disks for all NI Developer Suite.  How can I find out what software products are covered by this serial number?