Script to select all overflow text frames and fit them to content?

I have a document with several text frames that have overset text, due to replacing a font.  I was looking for a script that would:
1. find all the text frames that have overset text
2. apply "fit frame to content" command for each of these
Can anyone please help me here?  I'm trying to learn scripting but some of these things still confuse me.  Thanks.

hi,
give a try to this js code:
var _d = app.documents[0];
var _allStories = _d.stories;
for(var n=_allStories.length-1;n>=0;n--){
var _storyAllTextFrames = _allStories[n].textContainers;
for(var m=_storyAllTextFrames.length-1;m>=0;m--){
_storyAllTextFrames[m].select();
            //Fit Frame to Content:
            try{
            app.scriptMenuActions.itemByID(11291).invoke();
                }catch(e){};
           try{
           app.scriptMenuActions.itemByID(278).invoke();
                }catch(e){};
Disclaimer:
I'm NOT a scripter. Sorry, don't remember exact origin of this code, but it works...

Similar Messages

  • Select all Linked Text Frames

    Dear All,
    My Request:
    1. Is it possible to select all linked text frames of my selecting text frame (Please refer attachment)
    2. Suppose If we select all text frames, is it possible to fix height for all text frames like as 3p or 4p etc....
    Trying script for select all linked text frames:
    if (app.selection[0].nextTextFrame == null)
       if (app.selection[0].previousTextFrame != null)
            alert("pass")
            app.select(previousTextFrame.parent) && app.select(nextTextFrame.parent) && app.select(startTextFrame.parent)
    Could you anyone give solution for my request.
    Thanks in advance
    Beginner

    Hi All,
    If I select any text frame, I need to select all linked text frames of selecting text frame.
    Please can anyone help me...
    Please refer the above screenshot for your reference.
    Trying script:
    if (app.selection[0].nextTextFrame == null)
       if (app.selection[0].previousTextFrame != null)
          myParagraphs = app.selection[0].parentStory.paragraphs;
          for (j=0;j<myParagraphs.length;j++)
            myParentTF = myParagraphs[j].parentTextFrames[0].contents
            alert(myParentTF)
    Output i needed:
    Thanks in advance
    BEGINNER

  • I used to give my photo's keywords. Most of the time I have several photo's for the same keyword and it was possible to select all those photo's and give them the keyword in one move. Since of few weeks I can't do that anymore and I find it very annoying.

    I used to give my photo's keywords. Most of the time I have several photo's for the same keyword and it was possible to select all those photo's and give them the keyword in one move. Since of few weeks I can't do that anymore and it's very annoying. What can I do to get back to the former situation?

    . Since of few weeks I can't do that anymore and it's very annoying. What can I do to get back to the former situation?
    Check, if you have the "Primary Only" option enabled. Then keywords will only be applied to the "Primary Image":
    See:                  Keywords or ratings are applied only to one of the selected images - why?
    Uncheck the little square button with the "1".

  • Selecting all files from JFilechooser and renaming them??

    dear all
    i am working on a application that selects the jpeg,jpg,jpe files form the jfilechooser with an additonal botton rename which calls the rename method and the selected file is renamed.
    i have been succssful in mselecting one file and renaming it.but the problem is with...
    1) Selection of multiple files and sending their names and parent directories getParent(); is not working with taht....should i use arrays to store that .....but how when i have enabled multiple selection already.
    2)SEcond problem is to refersh the contents of JFileChooser after i have renamed it.iwant that it shopuld be refreshed automatically just after renaming has been done.
    help is always appreciated..
    regards
    s m sharma (trainee s/w/ engg)

    hi everybody
    i have done it myself.......it was not too tough that u didnot responed...anyway thanks..
    regards
    s m sharmna

  • [JS][CC] How can I get the last visible character in an overflowed Text Frame?

    Hello
    I'm new in InDesign scripting in javascript. I would like to know if there is a way to get the position of the last character in a Text Frame that is overflowed? I need this because I want to calculate how many characters are hidden (overflowing text) via script.
    I've searched in the forums about this but what I find is always a script for alerting if there's overset text or not.
    I'd really appreciate any help!

    Well, let's say that myFrame is an overflowing text frame.
    So, the last character in that frame would be
    myFrame.characters[-1];
    To calculate the number of overflowing characters, select the
    overflowing text frame, and run this script:
    myFrame = app.selection[0];
    myParentStory = myFrame.parentStory;
    alert("Number of overflowing characters is
    "+myParentStory.characters.itemByRange(myFrame.characters[-1],
    myParentStory.characters[-1]).length-1);
    Ariel

  • Bullet problem when creating text frames and tables in InDesign CS5

    Every time I create a new text frame or table in InDesign CS5 and paste information there, the first row in the table or several lines of text come out with bullet points. I'm sure this is a setting or style at some point I created and now am unsure of how to delete. I would like the new text frames and tables to not include bullet points as a default when imported or pasted. Any thoughts? Thanks!

    Defaults for text in the current document are made with no text selected. Turn off bullets and they should stay off (but check the styles, too, you might have accidentally set a bulleted style as the defualt and you should change the default style instead). If this is happening in all files, you need to do it with nothing open to reset the default for all new documents (existing files, unfortunately, need to be fixed one at a time).

  • CS3/4, JS Amateur question: how remove all empty text frames?

    I'm an amateur, and thought it would be a straightforward matter to write a script that simply deletes all empty text frames in all of a document's stories. Here's my second attempt:
    var myDocument = app.activeDocument;
    var myStories = myDocument.stories;
    for (i = 0; i < myStories.length; i++){
      var myStory = myStories[i];
      var myTextFrames = myStory.textContainers;
        for (j = myTextFrames.length - 1; j >=0; j--) {
        if (myTextFrames[j].contents == "") myTextFrames[j].remove();
    The trouble is, sometimes it works as intended, but sometimes, with multiple stories, it needs to be run more than once. Can anyone explain why that is?
    Thanks -- Jeremy

    [Jongware] wrote:
    (Bit of a Johnny-come-lately, but anyway )
    AHA! -- This is a great help. It was driving me up the wall, and I don't know why it didn't work for me last night. Maybe it's because I was counting through stories in the wrong direction. Anyhow, I see how it works now, and I'm very grateful for the help.
    By the way Harbs, I used all three of your suggestions because I had spent far too much time tapping away at that nut with my little toy hammer. I vented my frustration by using all three of your sledgehammers. In particular, I made sure it left a single empty text frame where it was, as such a frame might be used as a graphic. (Although in the past, I've found an empty story can be a sneaky place for a rogue font to hide. The insertion point just in front of the "end of story" character can have a paragraph style applied, with its associated font, but "Find" won't find any characters with that paragraph style or font applied!)
    Thanks to all again -- Jeremy

  • Uneven color between background text frame and underlying frame fill

    Hi. I'm using InDesign CS3 on Windows XP.
    On my document, the main heading is in a frame with a fill of 'None'. The heading text has a bevel and emboss. The text frame sits on a background A4 frame which is filled with a Pantone spot colour.
    When I print the cover page, the color filling the text frame is slightly different from the background Pantone color, even though the text frame has no color fill.
    When I checked the document before printing in View>Overprint Preview, it appeared to be fine. The PDF also looked fine. In both situations, I could not discern a color difference but it is there in the printed document.
    To provide a color behind the text which matches the fill color of the frame occupying the whole page, what should I do? My gut feel is to select the background frame and the text frame and check the knockout box on the effects panel or something like that.
    I hope I have explained sufficiently clearly the problem I am experiencing.
    Look forward to hearing your suggestions.
    Thanks
    Frank

    http://indesignsecrets.com/eliminating-ydb-yucky-discolored-box-syndrome.php

  • Selecting all "similar" text - is it possible?

    I have a feeling this isn't possible but i thought best go ahead and ask anyway...
    I have converted a document from Quark (gasp!) to InDesign. All has gone well except the leading is a bit too close. The character styles haven't been correctly brought through from Quark so it's not simply a case of changing those, and i was thinking, you know the way in Illustrator for example you can select all items with the same colour stroke or fill and then change all accordingly, is there a way of selecting all the text with the same properties or am i going to have to go through every little text box in this 800 page document and change all the leading one by one?!
    Using mac 0s x 10, InDesign CS3

    You should have used Paragraph Styles instead of character styles.
    Use a Paragraph Style for whole paragraphs of text (even if one line) and use Character styles to give attributes to single characters/word(s) withing a paragraph.
    With everything having Paragraph Styles you can have Space Above and Space Below attributes for the paragraphs.
    If you want to give everything Paragraph styles, then select a paragraph and make a new paragraph style.
    Search for your Body character style and replace it with your Pargraph style.

  • Copy text frames and paste in place from source file to opened docs

    Hello All,
    I have one source indd file which is having 10 small text frames (40pt square) in both pages (Facing pages, Left and Right) on a master page. In that master page there is no frame except that 10 small text frames and the text frame contains the paragraph style called "Cat_Cont".
    I have opened some files and I want to copy that 10 small text frames from the source file and paste in place into the opened InDesign Docs master pages. I hope while copying that text frames, paragraph style also would copy. Could anyone help for this, please?
    If anything not clear plz let me know.
    Thanks in Advance,
    Thiru

    Use TextFrame.duplicate()

  • Select all the text on a page by touching an area that is white space

    I have read that you can select all the text on a page by touching an area that is white space, for example at the edge of a column. Sometimes this works for me, but most of the time it does not. Should it? Is there more to it? Is this a documented gesture?
    I want to be able to select all the text in a long page, where it would be very tedious to drag the copy handles. This would be the equivalent of CMD A on a computer.

    Yea, thanks, I've read that. It doesn't cover selecting all the text in one gesture, which is what I want to be able to do. This doesn't seem to be covered.
    I've been fooling around since I wrote the first post, and discovered that if you tap and hold to display the selection buttons (as noted in your quote) and then drag one of the blue selection buttons to the top (or bottom) of the text, then the other button will jump to the bottom (or top) and you have effectively selected all the text. This is what I wanted to do.
    The reason I wanted to do it is so I can select all the text in an article that I want to read, then copy and paste it into an app I just got, Speak it!, and then have the app read me the article while I get some exercise riding my stationary bike.

  • How do I select and email a whole lot of photos on my iPad from my iPad emails? It seems I have to go into Email and then insert one photo at a time? Isn't there a way to select all in the photos and then email the batch.?

    How do I select and email a whole lot of photos on my iPad from my iPad emails? It seems I have to go into Email and then insert one photo at a time? Isn't there a way to select all in the photos and then email the batch.?

    Actually, you can email up to 5 at a time from the Photos app. Select any more and the email share option will not appear.
    If you explain why you need to email large numbers of photos, we might be able to offer an alternative.

  • TS4436 How do I select more than one picture and send them all to Facebook on my iPhone 4s with iso7?

    How do I select more than one picture and send them all to Facebook on my iPhone 4s with iso7?

    Hi, I want to thank you for all your information regarding my questions about sending more than one photo to Facebook. I did have to stop in at Verizon (where I bought my iPhone) to find out why I did not have a choice to choose Facebook with the export icon. The tech had to go into my setting and enable Facebook to recognize my iPhone. When I upgraded to iso7 somehow it could not recognize Facebook. Once he did this for me I was able to follow your advice and your answer solved my question. Thank you

  • I have just selected all my desktop icons and accidentally deleted them.  This included my external hard drive with 22,000 photos in iPhoto.  I cannot open iPhoto now.  Can someone help please?

    I have just selected all my desktop icons and accidentally deleted them.  This included my external hard drive with 22,000 photos in iPhoto.  I cannot open iPhoto now.  Can someone help please?

    What is the file system of that external HD? is it MacOS Extended (Journaled)?
    Which iPhoto version do you have?
    If you directly select the iPhoto Library in the Finder and use "File > Get Info", does the library still show as "Kind: iPhoto Library" and is the file size correct for 22000 Photos?
    If the library does no longer have the correct size, restore it from your backup.
    But if the library has the correct size, try to open it directly by clicking it. This should work, if your iPhoto version is iPhoto '11.

  • Script to select all layers based on condition?

    Do anyone have a script to select all layers based on either name or color label? Possibly using search but not necessarily?

    If you search this forum you will find script that will process all layers in a document.  You can modify one if them to skip the layers you do not want to process do nothing to the. The process uses recursion to process layers within layer groups,.

Maybe you are looking for

  • Uninstalling Adobe Bridge CS6 after installing Adobe Bridge CC

    I got all of my Adobe Applications on my MacBook Air through the new Adobe Cloud service. At that time, all of the applications were Adobe CS6. When I saw that Adobe Bridge CC was available, I downloaded it immediately. I had been having problems wit

  • More than 1 table ın trıgger

    hi Can I use more than one table ın the trıgger For example CREATE OR REPLACE TRIGGER security BEFORE DELETE ON table1,table2,table3 Message was edited by: Ricardinho

  • Adding new fonts to Symbian Anna on E6

    I wonder to know how to adding new fonts to Symbian Anna on my E6. Most of my Word and PowerPoint documents require some special fonts, such as Courier News, in order to display correctly. Does anyone know the solution?

  • Oracle EL 5 & 11gR1

    Hi, I am trying to get 11gR1 installed on Oracle Enterprise Linux 5. I am using VMWare (not Oracle VMware) for installing EL x86_64. I have downloaded the 5 parts of EL from the Edelivery, where i also see "Enterprise Linux Release 5 for x86_64 Sourc

  • Problem finding Adapter WSDL files......

    Guys, I have installed and configured a Siebel Adapter on AS 10.1.2.0.2, BPEL PM 10.1.2.0.2 and Adapters 10.1.2.0.2 on Solaris. My adapters WSDL file is located in $ORACLE_HOME/adapters/application/wsdls However, when I am build my BPEL process using