find and delete blocks of text with the same geometricBounds

Hi writer... .new question from here:

mySelection var = app.activeDocument.selection [0] .geometricBounds;

alert (mySelection);

throughout the document, I need search and delete blocks of text with the same geometricBounds.

If possible, the same dimensions, but not the same positions.

Thanks for the help!

OK Bala... .in to decimal differences, some executives have not been removed.

I solved with "Math.round' instead of 'number '.

===================

mySelection var = app.activeDocument.selection [0] .geometricBounds;

var myWidth = Math.round(mySelection[3]-mySelection[1]);

var myHeight = Math.round(mySelection[2]-mySelection[0]); Alert (myHeight);

var allFrames = app.activeDocument.allPageItems;

While (t = allFrames.pop ()) {}

{if (t.IsValid)}

var myTextframe = t.geometricBounds;

var myTWidth = Math.round(myTextframe[3]-myTextframe[1]);

var myTHeight = Math.round(myTextframe[2]-myTextframe[0]);

If ((myWidth == myTWidth) & (myHeight == myTHeight)) {}

t.Remove ();

}

}

}

===================

Now, your script works great!

Thank you very much!

Tags: InDesign

Similar Questions

  • How to take a column of duplicate names and fill a different column with the same names, excluding duplicates?

    How to take a column of duplicate names and fill a different column with the same names, excluding duplicates?

    I find easier to use this copy separate Automator Service (download Dropbox).

    To install in your numbers > Services, double-click menu just the package downloaded .workflow and if necessary give permissions in system preferences > security & privacy.

    To use, just:

    1. Select the cells in the column with duplicate names.
    2. Choose separate copy in numbers > Services menu.
    3. Click once in the upper cell where you want the deduplicated values appear.
    4. Command-v to paste.

    SG

  • in Acrobat 8 Standard advanced editing tool is grayed out in Windows 7 and Windows 10 but works with the same pdf file in Windows XP Professional. Why?

    in Acrobat 8 Standard advanced editing tool is grayed out in Windows 7 and Windows 10 but works with the same pdf file in Windows XP Professional. Why?

    Perhaps because Acrobat 8 is not compatible with Windows 7 or 10.

    Friday, October 9, 2015 at 22:11, thosdelaney [email protected]>

  • CS5 - most effective way to wire and independent streams of two blocks of text in the same document?

    Greetings...

    I am responsible for creating a 100-page instructor guide and I looking for a little guidance in the use of independent text blocks that thread the length of the document.  The idea behind the use of two columns, is that the first column (left) must be used for the notes 'instructor-only', advice, etc..  The second column (right) should be used for the text of the student guide.  Two columns (or blocks of text) would need to move independently of each other.  In other words, when the left column is filled with text placed on the page, the flow of additional text in the left column on page two, left column on page three, etc.  Same thing applies to the right column.  There is no link or thread of the text between the two columns on the same page.

    I tried to reproduce this in a two-column table format, however, the table row height is limited and overset text will not continue the table in the block of text on the next page.

    Thank you in advance for your help!

    Set up master page text frames.

    If you use facing pages, put on the student to the student and executive trainer instructor on master pages.

    Be very careful when your document is redéroule however. Take a look at this discussion, we had recently on the subject:

    http://forums.Adobe.com/message/3588735#3588735

    HTH,

    Substances

  • How can I delete a local account with the same name as the account online?

    I used my PC for a long time now using my account online, but has recently created a local account too. The original online account created a local folder with the name XXX_000 in the USERS folder.  Without thinking, I created a local account with the same account name name! (XXX_000). I realized my mistake, but I don't know how to remove the local account without removing all of the files for the account online! How can I remove the local account without affecting online account files?

    Do not try to remove the account from the folder.  To do inside the PC settings app and it should be good.

  • CS5, blocks of text with the selection tool.

    InDesign CS5:

    I work on several documents that requires to move blocks of text.

    When I select the text block with the selection tool, my cursor will move immediately to the text tool.

    I'm not double click, only clicking once to select.

    I don't want to edit text, select only the text block, so I can move it.

    Is there a way to disable this feature?

    Or maybe a tip and Trick so the tool rest the tool selection and not switch to the type tool.

    Thank you in advance.

    Kathryn

    As stupid as it may sound, try a different mouse.

    We prefer to keep the choice to convert an empty block to a block of text, but here already are blocks of text.

    Bob

  • Can I still use Windows journal, if I have the handwriting recognition and just type my text with the default keyboard input?

    I have a Gateway laptop computer and I tried to use Windows journal without handwriting recognition.  So, he feels a bit lame that I can't understand how to enter text with my default keyboard or whatever it takes.  I think I'm pretty computer, so maybe I am an annomaly of persanal that seems to happen to me a lot!  Thus, any help I can get with this problem would be cool.  I type to fast however, just hunt and Peck, so please be patient.  Thanks in advance!

    Best regards, bryznet

    Hi bryznet

     

    Windows Journal is part of the Group of Tablet PC accessories. It is not a keyboard application.
    It is an application ink for taking notes of ink and writing to text conversion.
    If you want to simply type in the text, you can use a word such as Notepad or Microsoft Office Word application.

    If you want a combination of features of ink and/or the text of note taking, then watch Microsoft OneNote (think of it as Notepad Word, OneNote is)
    http://Office.Microsoft.com/en-us/OneNote/

    I hope this helps.

  • Footer has the "BOLD" text on the home page, and not in other pages with the same CSS... <>?

    I can't find why the footer displays bold at Yolaine but not bold in the other 3 pages: more yolaine etc.

    style #Footer are the same (sesem.css), and returns html for all pages:

    < div id = "Footer" class 'fluid' = > Stichting Eigentijds Speelgoedmuseum, pressed en meer (Yolaine) < a href = "mailto: " [email protected] "> < br > .

    [email protected] < /a > & #124;  www.sesem.nl < br >

    NL11RABO0301748330 < br >

    & copy; 2015 Yolaine < / div >

    What Miss me?

    Thanks in advance,

    Martian

    On the homepage, it is bounded on other pages, that it is not in a strong tag.

    100 online you open a new tag strong but never shut it down:

    Interview Radio Oost met Jan Bugter, voorzitter Yolaine

    get rid of it and it wil work:

    Interview Radio Oost met Jan Bugter, voorzitter Yolaine

  • How can I contact the high-level support and have an interactive discussion with the SAME person?

    I tried to get a fix for a problem with my account and her affair with an old email address I want dissociated with my account.  I sent a very detailed and clear request to the service the customer and I get the same, I mean exactly, Word for Word response, which is not at all what I wonder.  In addition, I get these email responses and tells me that I can not reply to this message; I wonder to start a conversation.  Believe or not, when I started a conversation and pasted my explanation and asked that the representative has read my message, that person got sent back the same word-for-Word pre-formatted message.  At that time, I wrote a very detailed re-explanation of with the letters "BOLD" and everything, and the guy or the girl still he sends me a sentence canned.  In addition, it is called cat, but it takes 2 person 5 minutes to respond; they read very slowly or watch TV or something.  During the whole cat 30 min, this representative managed to never sending me a message that he or she actually typed. but the entire cat with all pre-formatted responses.  Are these real people or some sort of software experience HAVE?

    If this community of users is not monitored by Adobe personnel, then I know that this message cannot go anywhere that will help me.  But if anyone has a secret formula to get around the wall built the auto-bots on the front line and get to higher level support, I would appreciate a tip.

    Thank you

    Hello

    I sent you a message. Can you please check and answer?

    -Usman

  • Bill standard and a note of credit with the same amount

    Hello
    I have a standard AP invoice with an amount of €100 and the note of credit-€100.

    The standard invoice and credit rating have the same supplier and distribution and status are validated and recorded is Yes.

    How do I match this credit note to this invoice?

    If I try to create a payment with this invoice and credit note, I get an error because I can't make a payment to zero.

    I do so with a suspense account? How can I do?

    Thanks in advance!

    Hello.

    Enter a zero payment amount and select the two documents.

    Octavio

  • Static text is much better than the dynamic text with the same font settings

    Hello

    I have exactly the same parameters for static and dynamic text, but the static text seems much sharper. Someone knows why?

    Police: Trebuchet MS

    Size: 30 pt

    Anti-alias for readability

    There is a slight difference, but I would not say much better. Incorporate you the dynamic text characters.

  • Why is there a difference in length between 24 fps and fps 23 976 timelines with the same clip?

    I was working on a project of 23 976 fps and I tried to import a short animated sequence of 44 TIFFs in my scenario in my first CS5.

    I imported the sequence, interpreting the film at 23 976 fps (such as it was made in AE) to check before sending it to a finished House.

    First issue. Even if I set the framerate 23 976, first CS5, indicates me 23.98 on interpreting window film. I assumed it as a rounded number.

    When I drag the attachment to my 23 976 sequence, the clip shows 43 (!) length of frames on the info panel. It lacks an image. The sequence in the original video, it really lacks a framework.

    I decided to do a test. And placed the same clip, interpreted the same way on a sequence of 24 frames per second, and the clip shows as length of 44 executives on the info panel.

    How can we, same clip shows the different quantity of frames (I don't mean time, but just raw images), on different times? It makes no sense at all! If my sequence has 44 frames, it should show in the form of 44 independent frames of the scenario that I imported it. Am I entitled?

    Just for test, I ve imported from the same sequence on AE, and in it shows as 44 frames on a timeline 23 976. How can I trust to first frame interpret in this way?

    Just one thing. The scene used as basis for the animation of the AE, has 44 executives, and it was measured and cut in a 30s film on the same first which is having this weird behavior.

    Can someone explain to me what Just happened? It s driving me crazy!

    Thanks in advance

    Mauricio Mendes

    Before you import the sequence of images, go to Edit > Preferences > media... and together the basis of split time at 23.976.

  • Clone blocks of text with the titles bunch

    I hope someone out there can help us with this question.

    We have a book with an illustration on one page and a legend (list of issues) on the opposite page.

    The star of the picture must appear on both pages. The paragraph for the title style uses a format of automatic numbering.

    But we do not want the section on the right for the auto-numbering page, we want to clone what's on the left page.

    Is the a way to clone the title on page 1 (left page) so that it appears on page 2 (right page)?

    The goal is if the text is changed on the left page, the change is also displayed on the right page.

    The problem we found is that the cloned text block takes the next number of topic. For example, "1. Topic' on the left becomes "2. The topic"because of the paragraph style.

    We tried with related stories, text variables, etc., but the title on the right-hand side always takes the next number.

    Thoughts anyone?

    Thank you.

    Bruce

    InDesign CC - Windows

    Could not get this text variable to automatic numbering on the master page, but works well on the pages of the document.

    Thanks for the help!

  • How can I create a series of blocks of text using the Excel list values?

    It is first of all, the first script I am trying to write from scratch. I'm completely green at the script and I picked up a few bits of ID Adobe scripting guide, but nothing has really stuck still relating to this particular goal.

    My supervisor maintains a master list of advertising space, with the name of the account, is the width of the space, and how space is the height, in an Excel sheet. These spaces can number in the hundreds, and I'm stuck manually drawing a rectangle for each space, which takes a lot of time.

    I would like to create / helped to create a script that will take these values and "magically" to draw these spaces in the form of blocks of text, with the width (in columns) and the height (in inches) defined by the values in the main list, as well as the name of each account in the subsequent text frames.

    The script didn't necessarily need to be able to pull the values directly from the Excel sheet; Can I transfer a file text if necessary, or directly in the script, values he change because I need it. A great thing (if she is not able to pull directly from an Excel sheet) which is the number of spaces a week changes, and so do the accounts and the width and height. Accordingly, it would be ideal that values of the sheet could be modified easily, in order to create a new set of spaces as necessary.

    Positioning for each space is not crucial, only the height and width. If they were all on top of each other on the same page, it is a result for me. The main idea is to not have to draw them all manually, one by one.

    For me, this looks like a command, but I hope that some experienced there Scripting Guys can help me, because I want to become experienced as well.

    Thus, the TL; DR version:

    -Script to draw a series of text blocks.

    -Size of the text boxes should be defined by the values width and height of spreadsheet Excel.

    -Text blocks must have the account name as content (from account in the Excel worksheet names).

    -Accounts, width and height changes every week in the Excel sheet, so must be relatively easy to exchange all values.

    -Width values on the Excel worksheet columns. It would be ideal that the script could turn those numbers into multiples of columns as necessary.

    -Script (optionally) can take values directly from Excel sheet.

    -Script (option) can set the fill color for the gray text frame. (If it works as I think, I could just select all the resulting images of the text myself and put them all to grey at the same time... I'm not lazy as )

    Thanks in advance to anyone who can help in any way possible, even if it's just a little push in the right direction. This script will save 1 to 2 hours of boredom every week.

    Look like the perfect thing for the InDesign scripting.

    I copy content from Excel to a text file, for a format easily read in InDesign, and there will automatically be a TAB for each 'cell', just using copy and paste.

    Here is a piece of code, perhaps you could go on with (the addition of variable to change pages and the location on the page and other things).

    The readFileLineByLine function, can be easily reused with any function using "recall". You simply tell the function what you want to be executed for each line of text that reads:

    const COLUMN_WIDTH = 2; // Define the column width in inch
    
    var pageIndex;
    var textFramesExported; // not implemented.
    
    // Add a new dokument. Set myDoc to app.activeDocument to use
    // the current document instead of creating a new one.
    var myDoc = app.documents.add();
    
    // The doSomethingWithTextRow function is called upon for every line of text read.
    readFileLineByLine('c:\\test.txt', doSomethingWithTextRow);
    
    function doSomethingWithTextRow(row){
        // We expect the text line to be TAB separated (\t = TAB). We get that from just copying the contents of an
        // excel file into a text document.
        var cells = row.split('\t');
        var companyName = cells[0]; // The Company name in the first slot of the array
        var width = COLUMN_WIDTH * cells[1];
        var height = cells[2];
    
        // Create a new text frame for every row handled
        if (pageIndex==undefined) pageIndex = 0; // Count up when you have exported a number of texts, I leave this for you to do.
        var newTextFrame = myDoc.pages[pageIndex].textFrames.add();
        newTextFrame.contents = companyName;
    
        // The text frame is created in the top left corner.
        newTextFrame.geometricBounds = [0, 0, height + ' in', width + ' in']; // Top, Left, Bottom, Right 
    
        // You might want to move the textframes to other positions, keeping track of how many you put out per page.
        newTextFrame.move( [10, 10] );
    }
    
    function readFileLineByLine(path, callbackFn){
        var myFileIn = new File(path);
        if (File.fs == 'Windows'){
            // This was probably added to recognize UTF-8 (even without its start marker?)
            myFileIn.encoding = 'UTF-8';
        }
        myFileIn.open('r');
        var myEncoding = myFileIn.encoding;
        try{
            if (!myFileIn.exists){
                throw('Missing file: ' + myFileIn.fsName)
            }
            var ln = '';
            while(!myFileIn.eof){
                // Read the lines from the file, until an empty line is found [now as a remark].
                ln = myFileIn.readln()
                // if(ln !='' && ln!='\n'){
                   // Call the function supplied as argument
                   callbackFn(ln);
                // }
            }
        }catch(e){
            alert(e);
            gCancel = true;
        }
        finally{
            myFileIn.close();
        }
    }
    

    The file in C:\ in my example was recorded in UTF-8 format and looks like this (showing hidden characters):

    Post edited by: Andreas Jansson

  • find a block of text on the page with the name of script

    Hi all

    I need to create a script for

    find a block of text on the page with the script titled "xxx".

    and read its contents into a variable.

    The content of the text block is a number.

    Thank you

    Hello Roberto,

    Welcome to the forum,

    This is the textFrame marked on the current page.

    var myLabel = "Foo", // change to label
          myPage = app.properties.activeWindow && app.activeWindow.activePage,
          myTextFrames = myPage.textFrames.everyItem().getElements().slice(0),
          l = myTextFrames.length,
          myVariable
    
    while (l--) {
        if (myTextFrames[l].label != myLabel) continue;
        myVariable = myTextFrames[l].contents;
        break; // presuming there's only one "Foo" labeled frame on the page
        // Otherwise you'll nead an array
        }
    
    alert(myVariable)
    

    Trevor

Maybe you are looking for