CS3/4 question, Amateur of JS: how to remove all the blocks of text empty?

I am an amateur and thought it would be a simple matter to write a script that simply deletes all empty all text blocks in all stories of a document. Here is my second attempt:

myDocument var = app.activeDocument;

var myStories = myDocument.stories;

for (i = 0; i < myStories.length; i ++) {}

var monarticle = myStories [i];

var myTextFrames = myStory.textContainers;

for (j = myTextFrames.length - 1; j > = 0; j-) {}

If (.silence myTextFrames [j] == ' ') myTextFrames [j] .remove ();

}

}

The problem is sometimes it works as intended, but sometimes with multiple stories, it must be executed many times. Can someone explain why this is?

Thank you - Jeremy

Your problem is that you treat the stories forward, but are

removal of the stories completely empty, then the script will skip the

stories after that removed.

You must do one of the following:

(1) do not remove the first picture on any topic.

(2) use a loop for the stories

(3) convert the stories collection into an array:

var myStories = myDocument.stories.everyItem () .getElements)

Substances

Tags: InDesign

Similar Questions

  • How to remove all the photos from my iphone 5?

    How to remove all the photos from my iPhone 5?

    1. Open the Photos app.
    2. Click on the photo or video you want to delete.
    3. Type > delete the Photo.

    Delete several photos

    1. Open the Photos app and press Select.
    2. Click on each photo or video that you want to remove.
    3. Type > delete Photos.

    Delete photos on your iPhone, iPad and iPod touch - Apple Support

  • How to remove all the pictures imported from my I phone 6

    How to remove all the pictures imported from my I phone 6

    Imported from the place where?

    If they were imported from your computer, you remove the same way that you put on there: by syncing with iTunes. to remove them, you need to synchronize an empty folder, or simply turn off the Photo in the form of synchronization option summary pane when the iPhone is connected.

  • How to remove all the exhibitors?

    How to remove all the exhibitors of large document?

    I tried to use find/replace and then find format, but I couldn't find the Exhibitor box.

    In find/replace, in Format to find, go to the basic character Formats section and it is in the drop Position down to the right.

  • I still have not found "help" to tell me how to remove all the lines and columns beyond those needed for my spreadsheet.

    I used several worksheets.  More allows me to specify the rows/columns and then delete them.  This is to remove all the lines/columns beyond those set up and formatted for my spreadsheet.   I tried many ways to remove all additional lines/columns, but without success.  I even took the time to scroll down/on to highlight all the unnecessary lines and columns, but they do not remove it.
    Any suggestions?  I used spreadsheets most allow me to specify the number of rows/columns for my worksheet

    You can ask your question in the office | Excel Forum because it is not really a problem of Windows XP performance and maintenance.

    Office | Excel

    http://answers.Microsoft.com/en-us/Office/Forum/Excel

    Also, providing specific information may help to get a faster response or better, such as the version of Office or Excel? version of Windows XP? Home, Pro, 32-bit or 64-bit.

    I hope this helps.

  • How to remove all the groups from shared Services?

    Hi, how can I remove all the native directory of Shared Services in the form of groups?

    Select the groups under native, select Show all, press shift or control, you can select groups, once the groups are selected, right click on and select Remove.

    Thank you

    ~ KKT ~.

  • How to remove all the pixels of a certain color?

    Hello

    I'm removing all the white pixels of my image and they are transparent. Is this possible and if so, how?

    Thank you

    Brandon

    1. Open image file
    2. Duplicate the background layer, close the visibility of the background layer by clicking on the "eye", to work on the background layer copy icon
    3. Magic wand of access tool. In the tool options bar, uncheck the "contiguous".
    4. Click on a white box, hit DELETE on the keyboard
  • How to remove all the transitions?

    I used the automate to sequence with the default transition. A few tens of transitions have been added to the sequence.
    How to remove all transitions without deleting the sequence and starting from scratch, please?

    Thanks in advance.

    Shift + select them and delete them.

    / Roger

  • How to remove all the songs in a playlist of my itunes library?

    My request here is, is it possible that I can select all the pieces that I have selected in iTunes and delete all of these songs in my iTunes library. To clarify I'm asking not how to remove and individual songs or how to remove a playlist, I want the songs within a time to be gone, or deselected somehow.

    Basically, I recently bought a new laptop and I've been moving all of my music from the old laptop to the new aid, sticks of memory of 8 GB that I don't have an external hardrive and would rather not pay for someone else to come and move the contents of my hard drive from one to the other. On my previous laptop, I had a playlist containing all the songs I want on my phone for synchronization purposes, as I had too much music to store it all. For reasons to keep this playlist and without having to build all over again I first transferred the music in the playlist of phone. The problem is I now want to transfer the songs that aren't in that playlist aswell, but I can't find anyway to select only the titles so that I can drag them into my memory stick. I can't delete the songs in the playlist one by one as there are almost 6000 titles in there then, obviously, that would be very time consuming.

    Thanks in advance for any help you can give

    I would recommend before you do anything destructive with your library you backup your iTunes for Windows with SyncToy library. It is also the tool I would recommend that you use to transfer the library to a computer, first back up and restore then (in a folder empty) to the other machine. Doing it this way means that you get the sides play heads of prosecution, playlists, date added, and that you don't have to erase and reload your content. It also ensures that you have a backup! Hard drives external are quite cheap and you should not skimp. That said, if the two computers are on the same network, you can use SyncToy to copy the iTunes folder from one to the other, if you open the folder music sharing on a computer, so it can be seen from the other.

    As for the original question, Ctrl + A to select everything in a playlist. SHIFT-DELETE to remove it from the library. But I really wouldn't like that.

    TT2

  • Batch how to remove all the photos that I deleted the photo library

    After a few months of use of the Photos App and deleting photos, I would like to know how to remove the hard disk all the pictures I deleted so far. (recently deleted folder is empty).

    Thanks for any suggestions.

    If your photo library is migrated from iPHoto then you will need to remove them in iPhoto too - or if you are sure you are finished with the iPHoto library archive yoru iPHoto and delete and empty the trash

    LN

  • How to remove all the images from the photo library in one remove

    I deleted the photo library of the file Explorer, but images still remain in the application of the photo library. I know not how to remove them one at a time but

    This would be very time consuming because there are about 1500 photos involved. They are not valuable because they are because they are not divided

    in albums. I have them in separate albums elsewhere and would like to have separated at this computer at a later stage. Any help appreciated.

    Hi Doris,.

    When you select a picture, is there a graduation present in the photo?  If the tick mark is not there, which indicates that the photo was not selected.

  • How to remove all the drives except 0:0 "Computer1" and re - joining "computer2" all disks

    Hello

    I need to find a way with PowerCLI can I analyze virtual named "machine1" across all the disks on a computer off, and detach all disks except the system disk (0:0).  Next, I would like to re - join these discs "computer2".  Seems to be there should be a way to do this using the Remove Disk command, but I don't know how I would keep track of all the disks as Computer1 can have a different number of disks attached whenever I run this script.  Can anyone help?

    CK

    Try something like that.

    $vmName1 = "vm1.

    $vmName2 = "vm2.

    $vm1 = get-VM-name $vmName1

    $vm2 = get-VM-name $vmName2

    $hd = get-disk hard - VM $vm1

    $cntrl = get-controller SCSI - VM $vm1

    $cntrl0 = $cntrl | where {$_.} {ExtensionData.BusNumber - eq 0}

    $hd | %{

    If ($_.) ExtensionData.ControllerKey - only $cntrl0. ExtensionData.Key - or

    $_. ExtensionData.UnitNumber - no 0) {}

    $vmdkFile = $_. File name

    Remove-hard drive - HDD $_ - confirm: $false

    New-disk-hard - VM $vm2 DiskPath - $vmdkFile - confirm: $false

    }

    }

    Note that the script does not take into account the original SCSI controller, it added the VMDK to the first SCSI controller

  • How to remove all the information bar tool on the top and the sides on my pdf poster and attachments?

    All the information tool bar appears on my pdf copies when I record, when I open them and when I attach it to a message.  How can I delete all the information tool bar that I can send an own letter?

    Hi royb46676168,

    Using Acrobat application, you can set your preferences, viewing please see this KB document for help Acrobat help. Display of PDF files and preferences.

    Kind regards
    Nicos

  • How to remove all the images in the open documents

    Hi, experts

    How this script works out all the images in the open documents?

    function re() {}

    var link, image, image;
    var openDocs = app.documents.
    var openDocsLen = openDocs.length;
    for (var d = 0; d < openDocsLen; d ++) {}
    currDoc = openDocs [d],
    Links = currDoc.links,.
    counter = 0;
    for (var i = links.length - 1; i > = 0; i--) {}
    If (links [i] == docs.links) {}
    try {}
    link = links [i];
    image = link.parent;
    Frame = image.parent;
    Frame.Remove ();
    counter ++;
    }
    {} catch (err)
    $.writeln (i + "-" + err);
    }
    }
    }
    }
    }

    respect of

    John

    Dear John,

    Try your code updated.

    Re();

    function re() {}

    var link, image, image;

    var openDocs = app.documents.

    var openDocsLen = openDocs.length;

    for (var d = 0; d)< opendocslen;="" d="">

    currDoc = openDocs [d],

    Links = currDoc.links,.

    counter = 0;

    for (var i = links.length - 1; I > = 0; i--) {}

    If (links [i] .hasOwnProperty ('relink')) {}

    try {}

    link = links [i];

    image = link.parent;

    Frame = image.parent;

    Frame.Remove ();

    counter ++;

    }

    {} catch (err)

    $.writeln (i + "-" + err);

    }

    }

    }

    }

    }

    Best regards,

    K.Velprakash.

  • How to remove all the day archivelog backups?

    Hello

    Oracle 10 g 2 on 64-bit RHEL.

    Backup strategy:

    • There will be a level 0 of the database every Sunday and level 1 backup every working day.
    • Archivelogs will be saved up every 30 minutes.

    Q: How can I remove ALL archivelog backups that were taken that day there (every 30 minutes) just after the success of the backup of level 0 or level 1?

    I want to remove them because they will be of no use after the backup of level 0 or level 1 (am I right)?

    Best regards

    The idea of removing the archivelogs tape/disk backup will not only affect point in recovery time, but also be against the concept of RMAN retention policy. If your backup retention is of 7 days, RMAN manages backup element (Archives of newspapers/data/control files) are obsolete.

    Command below will delete backup logs to archive more than 1 day:

    DELETE the BACKUP OF archivelog until TIME = ' sysdate-1'. '.

    Thank you

    Josiane Vaidiyan

Maybe you are looking for

  • Pavilion g6: all devices audio immunoallergique, but still no sound

    • Windows 7 Home Premium 64-bit Service Pack 1 Laptop computer •Pavilion G6 •Produit number: A4G29AV •IDT high Definition Audio CODEC I can't some types of output audio through my headphones or speakers on board, even if all my speakers are working p

  • make a Subvi do something on first convocation

    Hello I have a Subvi I made and I want her to do something the first time that it is called as long as the delivery of the program, it should do something else.  Right now I have a "First Call" function connected to it, and they spend a tru the first

  • Kodak Easyshare stops working

    I have purchasedf a new camera Kodak M577. I have been using a C743 and download for Kodak easyshare for many years. While trying to get my new camera to download on Easyhare a uccesfully I lost my many years of photos in this file. "When I try to re

  • Beep code 1-1-1-1 from Presario V5094EA

    My Presario V5000 has renounced begin gradually.  Initially, I had problems with RAM occational market-code sound indicating.  The problem has gradually deteriorated and finally the laptop will not start. After cleaning contacts of the memory and the

  • Copy and DVD playback

    When I watch a DVD that I recorded since my camara to safety at home on a DVD recorder that I can't fast forward on HP media which is default as Microsoft media does not allow visualization.  I also want to make a copy of the DVD but I am unable to c