Deleting all the blocks of text hidden unexpectedly removes blocks of text embedded (but visible). Why?

I try to use the code below to remove all the blocks of text hidden in a document. It is works quite well, BUT for some reason, removes the visible anchor text blocks.

(the argument currentTextFrame.length is to prevent it remove hidden text blocks if the content is threaded, in which case the text is redéroule then in blocks of text that is visible.) I need to find a solution to this, but it's tomorrow problem.)

I have a similar function to allGraphics and does not remove the anchored frames.

Can someone point me in the right direction? I can add a check to see if the text block is anchored, but I fear that I might get bored the biggest problem.

var myDocument = app.activeDocument;
var myTextFrames = myDocument.stories.everyItem().textContainers.reverse();
var myTextFramesLength = myTextFrames.length;
for ( i = 0; i < myTextFramesLength; i++ ){
     var currentTextFrame = myTextFrames[i];
     if ((!currentTextFrame.visable) && (currentTextFrame.length ===1)){
          currentTextFrame[0].remove();
     }
}

_9781101983546_EPUB_SBs_indd___100_.png

Edit: What is happening in 2014.0 and 2015.1, OS x 10.10 CC

Post edited by: Naomi Kennedy

Hi Naomi,

and there is an array of arrays with:

myDocument.stories.everyItem().textContainers

Try this:

var a = app.documents[0].stories.everyItem().textContainers;
for(var n=0;n

I suggest the following, which should work:

var doc = app.documents[0];
var myStoriesArray = doc.stories.everyItem().getElements();
var storiesLength = myStoriesArray.length;

var textContainersToRemoveIDs = [];

for(var n=0;n

Uwe

Tags: InDesign

Similar Questions

  • How to delete all the phone numbers in the blocked list?

    How can I delete all the phone numbers in the blocked list?

    I want to delete a large number of blocked number, but now I can't remove the numbers blocked by one, are there ways to eliminate several numbers or the complete list at the same time?

    Thank you!

    No sorry. The fastest method seems to be to go to settings > phone > blocked (or settings > Messages > blocked) and select the editing mode. You could make a suggestion to Apple that offer more options: http://www.apple.com/feedback/iphone.html

  • Heights of game for all the blocks of text in a document

    Looking to do something seemingly simple. I want all the blocks of text in my document to the same height.

    Here's where I am.

    app.activeDocument.textFrames.everyItem () .height = "2.3195 in."

    Note: I work in InDesign CS5.

    Any help on where to go from here would be greatly appreciated.

    Or, in the CS6 and later*:

    var NEW_HEIGHT = '2.3195 in';
    
    // MULTIPLE RESIZE() IN ONE STEP
    // =============================
    app.activeDocument.textFrames.everyItem().resize(
    
        // Target bounding box(es) -- Use OUTER_STROKE_BOUNDS if needed
        // ---
        [CoordinateSpaces.INNER_COORDINATES, BoundingBoxLimits.GEOMETRIC_PATH_BOUNDS],
    
        // Reference point -- Here resize is performed relative to the top edge
        // ---
        AnchorPoint.TOP_CENTER_ANCHOR,
    
        // Absolute replacement
        // ---
        ResizeMethods.REPLACING_CURRENT_DIMENSIONS_WITH,
    
        // [width, height] in points
        // ---
        [ResizeConstraints.KEEP_CURRENT_VALUE, +UnitValue(NEW_HEIGHT).as('pt')]
        );
    

    * Can operate CS5. x too, but I think remember that CS4 has a bug where resize() is a plural specifier whose receptors belong to several blocks spread.

    @+

    Marc

  • I need to select all the blocks of text in a document and align text blocks in the back pages left frame margin and the text in the pages front to the right margin.

    Hello

    Am new to Java script.

    Can someone help me out here, I need to select all the blocks of text in a document and align text blocks in the pages back to the left margin frames and text in pages recto at the right margin.

    Thank you
    Harish

    Hi Harish,

    Try this.

    var doc =app.activeDocument,
        _pages = doc.pages;
    doc.viewPreferences.rulerOrigin = RulerOrigin.pageOrigin;
    for(var i =0;i<_pages.length;i++)
    {
            txfms = _pages[i].textFrames.everyItem().getElements();
            for(var j =0;j
    

    Kind regards

    Cognet

  • by selecting all the blocks of text on all visible layers

    I want to select all the blocks of text on all visible layers.

    the script below will select all the blocks of text, even in groups, but if the layer with the text is invisible the script error. (target layer cannot be changed)

    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 blocks of text on only visible layers, but now missing text belonging to 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 someone tell me why it is not some frames of text bound in a group when made this way and is it possible to get all managers of related texts selected on all visible layers?

    Thank you

    Duane

    Try this:

    if (app.documents.length > 0 ) {
        var doc = app.activeDocument;
        var numTextFrames = 0;
        for (  i = 0; i < doc.textFrames.length; i++ ) {
            try {
            textArtRange = doc.textFrames[i];
            textArtRange.selected = true;
            } catch (e) {}
            }
        }
    

    Have fun

  • I deleted all THE files of rendering but have still 1.5 TB of unidentifiable used disk space. I don't have FCPX libraries on my 3 TB drive. Total area of libraries: 650 GB still Get Info says I use 2 100 GB! Any ideas? Thank you.

    I have deleted all THE files in my libraries FCPX rendering but have still 1.5 TB of unidentifiable used disk space. I don't have FCPX libraries on my 3 TB external drive. The total size of my libraries is 650 GB (when I add up the individual), but when I click on read the information for the reader, it says that I use 2 100 GB! It does not show that everything is on the disk. I went in each library individually in FCPX and deleted all THE files of rendering.  Reducing the total size of several concerts, but there are still almost 1 500 GB difference.

    I tried to copy all libraries on another drive and they occupy only 650 GB (with no unidentifiable used disk space). I'm a bit confused.  Someone at - it ideas?  I would like to release 1.5 TB that starting to use the new hard disk with only 650 GB and reformat the drive, but if there is some kind of hidden, important files on the original drive as FCPX needs to work properly I won't ruin the hundreds of hours I spent on editing. I hope that all makes sense. Thank you in advance.

    I use an iMac 27 "with 3.4 GHz Intel Core i7, 8 GB of memory, NVIDIA GeForce 1024 MB graphics, OS X Yosemite 10.10.5, FCPX 10.2.2 3 TB Seagate USB 3.0 external hard drive designed for Mac and format Mac OS extended (Journal)

    That doesn't sound right. The sound of back numbers compared to what could happen.

  • How to find and delete all the exact words

    How search and delete all the exact words, I tried adobe 11 Pro and I still need to know how to do this

    No, this feature in Acrobat Pro XI can remove all occurrences of the text you're looking for in a single operation.

  • What I have to delete all the emails by hand or I can delete them all at the same time?

    How do delet all the emails at once?

    You can delete several at once. Press the button "Edit" in the mailbox, select e-mail then press on "trash".

    they must be selected one by one, there is no "select all" I remember

    If you have a lot to remove you may wish to do so outside the mail application. If your email provider has a web interface, use it. For example, I have yahoo mail, I use safari to go to yahoo.com and connect to my mail. then I will be able to select many emails at once (or maybe if your email provider supply)

    Can be faster if you have dozens, hundreds of delete

  • Hi I want to erase all the data from my current phone if I erase content and settings would be deleted all the data off my sim card? Thanks for your help

    Hi I want to erase all the data from my current phone if I erase content and settings would be deleted all the data off my sim card? Thanks for your help

    Erase the data on your phone will not erase the data on the sim card.

  • If I delete all the info on my old Mac so I can make a donation, it will affect my new Mac?

    IF I delete all the info on my old Mac, so it can be given, which will affect my new Mac?

    Follow the instructions in > what to do before you sell or give away your Mac - Apple Support

  • Hello.. I have a problem with the extensions folder... I confused with the extension folder in the library to cash... then I deleted all the stuff in the folder and restared my pc and its still in tha half and wont start... what I did?

    Hello.. Please I have a problem regarding the extensions library folder... I eccidentally deleted all the stuff in this folder and then I restarted my mac. His picture and it does not start... What have I done? I can somehow it repair? Sound on the screen to restart 2 hours... Thank you

    You must wipe the drive and reinstall OS X. In the future, you need to stay away from the data in the system until you know what it is and the consequences of the removal.

    Install or reinstall OS X from scratch

    Make sure that you have backed up your files because the following procedure will remove all of the hard drive.

    HD recovery start:

    Restart the computer after the ring, press in and hold the COMMAND and R keys until the menu screen to appear.

    Erase the drive:

    1. select in the main menu disk utility and click on the continue button.

    2. once the charges of THE select your boot volume (usually Macintosh HD) in the

    list on the left. Click on the Erase tab in the main window of THE.

    3. set the type of format Mac OS extended (journaled). If necessary, click

    Security and button all the option data from scratch in a single pass. Click

    the clear button and wait until the process is complete.

    4 leave FROM and return to the main menu.

    Reinstall OS X: Select reinstall OS X and click on the install button.

    Note : You will need an active Internet connection. I suggest to use Ethernet if possible

    because it is three times faster than wireless.

    This should install the version of Mac OS X that you had installed it.

  • What happens if I delete all the data of the Web site on my iPad mini?

    What happens if I select the option DELETE all THE DATA of the WEB site under Safari in the settings on my iPad mini?

    It clears all cookies, data, and the history of Safari.

  • How can I delete all the email our except one

    How to delet all the email our except one

    Try the tools | Accounts show the accounts and then you can delete what you want.  If this does not help, then check out the suggestions of Fazil.

    Steve

  • Memory of the computer on the Local C drive does not increase after deleting all the photos and the video.

    On my computer, the operating system is Windows Vista Home Premium. I am facing a problem, in which case, the amount of gigabytes, on the Local C drive.

    does not increase after remove/delete all the photos and video to my computer.

    I've done a disk cleanup.

    Any help will be greatly appreciated.

    Elliott R.

    Hello

    Check if the files that has been deleted and still resident in the trash, if so, empty the trash.

    http://Windows.Microsoft.com/en-us/Windows7/permanently-delete-files-from-the-Recycle-Bin

    Method 1;

    I suggest that you run the System File Checker.

    How to use the System File Checker tool to fix the system files missing or corrupted on Windows Vista or Windows 7

    http://support.Microsoft.com/kb/929833

    Method 2: Test the issue in a new user account.

    Create a user account

    http://Windows.Microsoft.com/en-us/Windows7/create-a-user-account

  • I deleted all the games that come with Windows XP including Solitaire. How can I get that back?

    I deleted all the games that come with Windows XP including Solitaire.  How can I get that back?

    Hi andypily1,

    Welcome to the Microsoft Answers community.

    Try the steps one by one and check below.

    STEP 1:
    How do I add or remove games in Windows XP
    http://support.Microsoft.com/kb/307768
     

    STEP 2:

    In most cases if the games are deleted from the computer files will remain on the computer.

    I suggest that you are looking for game files in the system32 folder.

    Later, click on Start menu click on run and type c:\\windows\system32 in the following search of the window for the file of games like free cell. If you get the files in the system32 folder then copy the file to c:\\program files\start menu\ later in the game folder.

    STEP 3:
    If fails it above steps, try a system restore to the point when the game was available on the computer.
     
    See the link below to learn how to perform the system restore.

    How to restore Windows XP to a previous state
    http://support.Microsoft.com/kb/306084

    Hope this information is useful.
    Let me know if it worked.
     
    Thank you, and in what concerns:
    Umesh P - Microsoft Support

Maybe you are looking for

  • Skype update

    Whenever I have Skype call a Skype message telling me who needs to go online or update of Skype, but when I'm in the call, he always said that I am offline even though I am in the call and sometimes it is said that people need to update and when they

  • Length of wire to the analog input in data acquisition

    What is the maximum length of the wire that can be used to connect the output of the sensor (4-20 MA) to my USB-DAQ(not sure of the model). This is important. The resistance of the wire will affect the accuracy of the measurement somehow?

  • sound driver for intel (r) core (tm) 2 quad cpu q6600@2.40ghz windows xp

    I need driver for pavilion hp intel (R) core (tm) 2 quad cpu q6600 2.40 mhz m9280.me

  • Blue screen of death when double monitoring

    Whenever I have connect a secondary monitor cable HD15 and go to the resolution of the screen (control Panel\Appearance and Personalization\Display\Screen resolution) and click on detect, the computer crashes and blue screen of death. After restartin

  • S441 GIS 21622/1 activity

    After the deployment of IMIS to day 441 we are seeing a huge amount of alerts for subsig 1. It seems unusual that the loyalty rating is 90, which means that the probability of this being a false positive is minimal. Everyone sees a large number of al