Table text frame width adjustment by script

Hi,
I have to capture my table cells within ‘Text Frame Width’ option with ‘Distribute Column Evenly’ , when it’s going to beyond the ‘Text Frame Width’. Is this possible by script?
by
hasvi

Hi Hasvi,
Try this.
var doc = app.activeDocument,
    _tables = doc.stories.everyItem().tables.everyItem().getElements(),
    _tfwidth, _cells, finalwidthofcell;
for(var i =0;i<_tables.length;i++)
        var currentwidth = 0;
        _tfwidth = _tables[i].parent.geometricBounds[3] - _tables[i].parent.geometricBounds[1];
        _cells = _tables[i].rows[0].cells;
        for(var j=0;j<_cells.length;j++)
                currentwidth +=_cells[j].width;
        if(currentwidth > _tfwidth)
                finalwidthofcell = _tfwidth/_cells.length;
                for(var k=0;k<_cells.length;k++)
                        _cells[k].width =finalwidthofcell;
Regards,
Chinna

Similar Messages

  • Set top and bottom inset spacing values in Text Frame Options via jsx script

    I am looking for a way to set the top and bottom inset spacing values only to 2 points in Text Frame Options via a .jsx scrpt.
    For years, I have used a script that sets Preferences, such as:
    with(app.storyPreferences){
        opticalMarginAlignment = false;
        opticalMarginSize = 12;                // pts
    I would like to add the code to this same script that would make Top = 0p2 and Bottom 0p2 but leave Left and Right as 0p0.
    Any help would be greatly appreciated.

    Here is the full .jsx file that we now use to set preferences.
    Ideally, this could be modified to include setting any text frame created to have 0p2 inset Top and Bottom, but 0p0 Left and Right:
    //ApplicationTextDefaults
    //An InDesign CS2 JavaScript
    //Sets the application text defaults, which will become the text defaults for all
    //new documents. Existing documents will remain unchanged.
    with(app.textDefaults){
        alignToBaseline = false;        // align to baseline grid
        try {
    //        appliedFont = app.fonts.item("Times New Roman");
            appliedFont = app.fonts.item("Helvetica");
        catch (e) {}
        try {
            fontStyle = "Medium";
        catch (e) {}
        autoleading = 100;
        balanceRaggedLines = false;
        baselineShift = 0;
        capitalization = Capitalization.normal;
        composer = "Adobe Paragraph Composer";
        desiredGlyphScaling = 100;
        desiredLetterSpacing = 0;
        desiredWordSpacing = 100;
        dropCapCharacters = 0;
        if (dropCapCharacters != 0) {
            dropCapLines = 3;
            //Assumes that the application has a default character style named "myDropCap"
            //dropCapStyle = app.characterStyles.item("myDropCap");
        fillColor = app.colors.item("Black");
        fillTint = 100;
        firstLineIndent = "0pt";
    //    firstLineIndent = "14pt";
        gridAlignFirstLineOnly = false;
        horizontalScale = 100;
        hyphenateAfterFirst = 3;
        hyphenateBeforeLast = 4;
        hyphenateCapitalizedWords = false;
        hyphenateLadderLimit = 1;
        hyphenateWordsLongerThan = 5;
        hyphenation = true;
        hyphenationZone = "3p";
        hyphenWeight = 9;
        justification = Justification.leftAlign;
        keepAllLinesTogether = false;
        keepLinesTogether = true;
        keepFirstLines = 2;
        keepLastLines = 2;
        keepWithNext = 0;
        kerningMethod = "Optical";
        kerningValue = 0;
        leading = 6.3;
    //    leading = 14;
        leftIndent = 0;
        ligatures = true;
        maximumGlyphScaling = 100;
        maximumLetterSpacing = 0;
        maximumWordSpacing = 160;
        minimumGlyphScaling = 100;
        minimumLetterSpacing = 0;
        minimumWordSpacing = 80;
        noBreak = false;
        otfContextualAlternate = true;
        otfDiscretionaryLigature = true;
        otfFigureStyle = OTFFigureStyle.proportionalOldstyle;
        otfFraction = true;
        otfHistorical = true;
        otfOrdinal = false;
        otfSlashedZero = true;
        otfSwash = false;
        otfTitling = false;
        overprintFill = false;
        overprintStroke = false;
        pointSize = 6.3;
    //    pointSize = 11;
        position = Position.normal;
        rightIndent = 0;
        ruleAbove = false;
        if(ruleAbove == true){
            ruleAboveColor = app.colors.item("Black");
            ruleAboveGapColor = app.swatches.item("None");
            ruleAboveGapOverprint = false;
            ruleAboveGapTint = 100;
            ruleAboveLeftIndent = 0;
            ruleAboveLineWeight = .25;
            ruleAboveOffset = 14;
            ruleAboveOverprint = false;
            ruleAboveRightIndent = 0;
            ruleAboveTint = 100;
            ruleAboveType = app.strokeStyles.item("Solid");
            ruleAboveWidth = RuleWidth.columnWidth;
        ruleBelow = false;
        if(ruleBelow == true){
            ruleBelowColor = app.colors.item("Black");
            ruleBelowGapColor = app.swatches.item("None");
            ruleBelowGapOverprint = false;
            ruleBelowGapTint = 100;
            ruleBelowLeftIndent = 0;
            ruleBelowLineWeight = .25;
            ruleBelowOffset = 0;
            ruleBelowOverprint = false;
            ruleBelowRightIndent = 0;
            ruleBelowTint = 100;
            ruleBelowType = app.strokeStyles.item("Solid");
            ruleBelowWidth = RuleWidth.columnWidth;
        singleWordJustification = SingleWordJustification.leftAlign;
        skew = 0;
        spaceAfter = 0;
        spaceBefore = 0;
        startParagraph = StartParagraph.anywhere;
        strikeThru = false;
        if(strikeThru == true){
            strikeThroughColor = app.colors.item("Black");
            strikeThroughGapColor = app.swatches.item("None");
            strikeThroughGapOverprint = false;
            strikeThroughGapTint = 100;
            strikeThroughOffset = 3;
            strikeThroughOverprint = false;
            strikeThroughTint = 100;
            strikeThroughType = app.strokeStyles.item("Solid");
            strikeThroughWeight = .25;
        strokeColor = app.swatches.item("None");
        strokeTint = 100;
        strokeWeight = 0;
        tracking = 0;
        underline = false;
        if(underline == true){
            underlineColor = app.colors.item("Black");
            underlineGapColor = app.swatches.item("None");
            underlineGapOverprint = false;
            underlineGapTint = 100;
            underlineOffset = 3;
            underlineOverprint = false;
            underlineTint = 100;
            underlineType = app.strokeStyles.item("Solid");
            underlineWeight = .25
        verticalScale = 100;
    //Units & Increments preference panel
    //Must do this to make sure our units that we set are in points. The vert and horiz
    //units that get set default to the current measurement unit. We set it to points
    //so we can be sure of the value. We'll reset it later to the desired setting.
    with(app.viewPreferences){
        horizontalMeasurementUnits = MeasurementUnits.points;    // Ruler Units, horizontal
        verticalMeasurementUnits = MeasurementUnits.points;        // Ruler Units, vertical
    //General preference panel
    with(app.generalPreferences){
        pageNumbering = PageNumberingOptions.section;    // Page Numbering, View
        toolTips = ToolTipOptions.normal;                    // Tool Tips
    // Not supported in CS4
    //    toolsPalette = ToolsPaletteOptions.doubleColumn;    // Floating Tool Palette
        completeFontDownloadGlyphLimit = 2000;                // Always Subset Fonts...
        try {
            //Wrapped in try/catch in case it is run with CS4 and earlier to avoid the error
            preventSelectingLockedItems = false;                // Needed for CS5+
        catch (e) {}
    //Type preference panel
    with (app.textEditingPreferences){
        tripleClickSelectsLine = true;    // Triple Click to Select a Line
        smartCutAndPaste = true;        // Adjust Spacing Automatically when Cutting and Pasting Words
        dragAndDropTextInLayout = false;    // Enable in Layout View
        allowDragAndDropTextInStory = true;    // Enable in Story Editor
    with(app.textPreferences){
        typographersQuotes = true;            // Use Typographer's Quotes
        useOpticalSize = true;                // Automatically Use Correct Optical Size
        scalingAdjustsText = true;            // Adjust Text Attributes when Scaling
        useParagraphLeading = false;    // Apply Leading to Entire Paragraphs
        linkTextFilesWhenImporting = false;    // Create Links when Placing Text and Spreadsheet Files
    // Missing following (Font Preview Size, Past All Information/Text Only)
    //Advanced Type preference panel
    with(app.textPreferences){
        superscriptSize = 58.3;                // Superscript, size
        superscriptPosition = 33.3;            // Superscript, position
        subscriptSize = 58.3;                // Subscript, size
        subscriptPosition = 33.3;            // Subscript, position
        smallCap = 70;                        // Smallcap
    with(app.imePreferences){
        inlineInput = false;                // Use Inline Input for Non-Latin Text
    //Composition preference panel
    with(app.textPreferences){
        highlightKeeps = false;                    // Keep Violations
        highlightHjViolations = false;            // H&J Violations
        highlightCustomSpacing = false;            // Custom Tracking/Kerning
        highlightSubstitutedFonts = true;    // Substituted Fonts
        highlightSubstitutedGlyphs = false;    // Substituted Glyphs
        justifyTextWraps = false;                // Justify Text Next to an Object
        abutTextToTextWrap = true;                // Skip by Leading
        zOrderTextWrap = false;                    // Text Wrap Only Affects Text Beneath
    //Units & Increments preference panel
    with(app.viewPreferences){
        rulerOrigin = RulerOrigin.spreadOrigin;                    // Ruler Units, origin
    //    These are set at the end of the script after all the changes have been made
    //    horizontalMeasurementUnits = MeasurementUnits.points;    // Ruler Units, horizontal
    //    verticalMeasurementUnits = MeasurementUnits.inches;        // Ruler Units, vertical
        pointsPerInch = 72;                    // Point/Pica Size, Points/Inch
        cursorKeyIncrement = 1;                // Keyboard Increment, Cursor Key
    with(app.textPreferences){
        baselineShiftKeyIncrement = 2;    // Keyboard Increment, Baseline Shift
        leadingKeyIncrement = 2;        // Keyboard Increment, Size/Leading
        kerningKeyIncrement = 20;            // Keyboard Increment, Kerning
    //Grids preference panel
    with(app.gridPreferences){
        baselineColor = UIColors.lightBlue;    // Baseline Grid, Color
        baselineStart = 48;                        // Baseline Grid, Start
        baselineDivision = 6;                    // Baseline Grid, Increment Every
        baselineViewThreshold = 50;                // Baseline Grid, View Threshold
        baselineGridRelativeOption = BaselineGridRelativeOption.topOfPageOfBaselineGridRelativeOption;    // Baseline Grid, Relative To
        gridColor = UIColors.lightGray;            // Document Grid, Color
        horizontalGridlineDivision = 12;    // Document Grid, Horizontal, Gridline Every
        horizontalGridSubdivision = 12;            // Document Grid, Horizontal, Subdivisions
        verticalGridlineDivision = 12;            // Document Gird, Vertical, Gridline Every
        verticalGridSubdivision = 12;            // Document Grid, Vertical, Subdivisions
        gridsInBack = true;                        // Grids in Back
        documentGridSnapto = false;                // snap to grid or not
        documentGridShown = false;                // show document grid
    //Guides & Pasteboard preference panel
    with(app.documentPreferences){
        marginGuideColor = UIColors.violet;                // Color, Margins
        columnGuideColor = UIColors.magenta;            // Color, Columns
    with(app.pasteboardPreferences){
        bleedGuideColor = UIColors.fiesta;                // Color, Bleed
        slugGuideColor = UIColors.gridBlue;                // Color, Slug
        previewBackgroundColor = UIColors.lightGray;    // Color, Preview Background
        minimumSpaceAboveAndBelow = 72;                    // Minimum Vertical Offset
    with(app.viewPreferences){
        guideSnaptoZone = 4;                            // Snap to Zone
    with(app.guidePreferences){
        guidesInBack = false;                            // Guides in Back
    //Dictionary preference panel
    with(app.dictionaryPreferences){
        composition = ComposeUsing.both;    // Hyphenatin Exceptions, Compose Using
        mergeUserDictionary = false;    // Merge User Dictionary into Document
        recomposeWhenChanged = true;    // Recompose All Stories When Modified
    // Missing (Lang, Hyph, Spelling, Double Quotes, Single Quotes)
    //Spelling preference panel
    with(app.spellPreferences){
        checkMisspelledWords = true;                    // Find, Misspelled Words
        checkRepeatedWords = true;                        // Find, Repeated Words
        checkCapitalizedWords = true;                    // Find, Uncapitalized Words
        checkCapitalizedSentences = true;                // Find, Uncapitalized Sentences
        dynamicSpellCheck = true;                        // Enable Dynamic Spelling
        misspelledWordColor = UIColors.red;                // Color, Misspelled Words
        repeatedWordColor = UIColors.green;                // Color, Repeated Words
        uncapitalizedWordColor = UIColors.green;    // Color, Uncapitalized Words
        uncapitalizedSentenceColor = UIColors.green;    // Color, Uncapitalized Sentences
    //Autocorrect preference panel
    with(app.autoCorrectPreferences){
        autoCorrect = true;                            // Enable Autocorrect
        autoCorrectCapitalizationErrors = false;    // Autocorrect Capitalization
    // Missing (Language, Misspelled word pairs)
    //Display Performance preference panel
    with(app.displayPerformancePreferences){
        defaultDisplaySettings = ViewDisplaySettings.typical;    // Preserve Object-Level
        persistLocalSettings = false;
    // Missing (antialiasiing, greek below
    //Story Editor Display preference panel
    with(app.galleyPreferences){
        textColor = InCopyUIColors.black;                // Text Color
        backgroundColor = InCopyUIColors.white;            // Background
        smoothText = true;                                // Enable Anti-Aliasing
        antiAliasType = AntiAliasType.grayAntialiasing;    // Type
        cursorType = CursorTypes.standardCursor;    // Cursor Type
        blinkCursor = true;                                // Blink
    // Missing (Font, Size, Line Spacing & Theme)
    //File Handling preference panel
    with(app.generalPreferences){
        includePreview = true;                        // Always Save Preview Images with Doc
        previewSize = PreviewSizeOptions.medium;    // Preview Size
    with(app.clipboardPreferences){
        preferPDFWhenPasting = false;                // Prefer PDF When Pasting
        copyPDFToClipboard = true;                    // Copy PDF to Clipboard
        preservePdfClipboardAtQuit = false;            // Preserve PDF Data at Quit
    // Missing (Enable Version Cue)
    //    Optical margin (hanging punctuation, outside margins)
    with(app.storyPreferences){
        opticalMarginAlignment = false;
        opticalMarginSize = 12;                // pts
    //Wrap Up (do at end of script)
    //Units & Increments preference panel
    //Must do this to make sure our units that we set are in points. The vert and horiz
    //units that get set default to the current measurement unit. We set it to points
    //so we can be sure of the value. We'll reset it later to the desired setting.
    with(app.viewPreferences){
        horizontalMeasurementUnits = MeasurementUnits.picas;    // Ruler Units, horizontal
        verticalMeasurementUnits = MeasurementUnits.inches;    // Ruler Units, vertical
    //    These two flags are turned off to avoid the error message about
    //    missing image links when InDesign opens an ad. This can especially
    //    be a problem when doing batch processes.
    with(app.linkingPreferences){
        checkLinksAtOpen = false;            // checkbox: true/false
        findMissingLinksAtOpen = false;        // checkbox: true/false

  • How to set italic to a text frame with a JS script

    Hello guys,
    I'm a java developper, and for my customer I have to generate some JS scripts for Illustrator CS3/Windows XP.
    In my use case, I need to layout several textframes. Some need to be "bolded", some others have to be underlined, and some need to be italic.
    I found how to set the bold and underline attributes, but for the italic, I can't see any option related to it. I saw the "CharacterAttributes#italics" property, but the description is a bit odd: "If true, the Japanese OpenType
    font supports italics."... it doesn't fit my needs...
    Is it possible to make a text italic with a JS script in Illustrator?

    You will have to use the proper italic form of the font. AI does not support Faux italic or bold.

  • Is it possible to select an anchored object in a text frame in InDesign in a script?

    I would like to know if it is possible to write a script to select an anchored object in a text frame. All the scripts I have found so far do not work on anchored object.

    Check out this thread.

  • Best SEO practices for text frames in content areas

    Hello,
    Is it best practice for SEO to keep all text (H1, H2, H3 <p> etc.) on a web page in one text frame and adjust with spacing between paragraphs to add additional elements (Video, widgets etc.) or is it better to use separate text boxes and place elements between them?
    Thanks! Below is an example. Should the H1 and both paragraphs be in one text frame space out to fit video or two separate text frames with the video between them?
    What is Lorem Ipsum?
    Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

    In the example you give, I would put both sets of text in a single box with a blank spacer between them for the video which would then be layered over the top to appear in the middle.
    The video takes longer to download and may also be blocked by the users settings so having it separate allows my text to load (and appear) quickly even if the video encounters issues.
    I would only separate the two text sections if they are clearly different in style or content and that’s really only helpful if you want a phone and/ or tablet version of your pages… it makes your life easier then to have the text in separate containers when you want to sync them across the different layouts.

  • [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

  • [AS] Access Text Frame Labels in CS5

    Hello Everyone,
    I am updating a CS2 InDesign AppleScript to CS5 and finding an issue accessing the text frame labels. In CS2 the script below would set the variable x to the contents of the text frame "bob", unfortunately, this script not longer works in CS5.
    tell application "Adobe InDesign CS2"
            set x to contents of text frame "bob" of active document
    end tell
    The documentation tells users how to insert text, but not access it. If anyone has an idea of how to do this in CS5 I would appreciate it.

    Got it!
    tell application "Adobe InDesign CS5"
         tell active document
              set x to contents of item 1 of all page items whose label is "bob"
         end tell
    end tell

  • Rounded corners on text frames in FrameMaker...

    First, thank you.
    Does anybody know if there is a way to put "rounded corners" on text frames?
    Thank you!!!!!!!!!!!!

    Other than with the graphic tools, FM doesn't cleanly support RRs, such as for tables, text frames, or frame generally. Some other WP/DTP apps do.
    In a prior career I had to use drawn or imported RRs in-frame during a fleeting period when the enterprise styleguide demanded it. It was replaced by rectangles shortly thereafter, but they also switched to pallid pastels and an illegible core font, just to sustain the pain.
    I predict that by the time FM gets comprehensive RR capability, the art directors of the world will have decided that the corners really need to be hyperbolic arcs, with drop shadows, central radial gradients and a subtly throbbing glow.

  • Tables inside overset text frames

    Hi everybody!
    Im trying to write a script to set the width of all tables in a document equal to its parent text frame, I was succesful, but
    the tables that are overflowed do not get resized. I have only come up with a way to find if there is an overflowed text frame
    but not to find and overflowed text frame contents. PLS HELP!
    heres my code:
    //resizes tables
    var myTextFrames = app.activeDocument.textFrames.everyItem();
    var myTables = myTextFrames.tables.everyItem().getElements();
    for (var i = 0; i < myTables.length; i++){
             var myTextFrame =  myTables[i].parent;
                        var myWidth = myTextFrame.visibleBounds[3] - myTextFrame.visibleBounds[1];
                myTables[i].width = myWidth;
    //finds a textframe with overset text
    var myOverset = app.activeDocument.textFrames.everyItem().getElements();
                    for(var x = 0; x < myOverset.length; x++){
                        if(myOverset[x].overflows == true){   
                        alert("There is overset text")

    @Kai – cool. Maybe just a little thing:
    You suppose that the first text frame of a given story has the same width as the one with the overset (holding a table in the overflow).
    So, if we have the following situation:
    A table in the overflow will get too wide after running your script:
    Instead of the first text frame in the story we could address the last one directly with:
    else if ( container.constructor.name == "Story" ) {
        var myTextFrame = container.textContainers[0].endTextFrame;
    And the result will be:
    The property endTextFrame is in the class of TextFrame.
    We could also have written:
    else if ( container.constructor.name == "Story" ) {
        var myTextFrame = container.textContainers[container.textContainers.length-1];
    Uwe

  • Help with adjusting layout, re-sizing text frames and images to fit new margin?

    i'm using InDesign CS5.5. I have a layout with several text frame boxes as well as some jpg and pdf images. I'm expanding the margin on one side and want to expand the text frames to utilize the extra space rather than just shift everything over. I've used the adjust layout script (which still requires some manual adjustment after) and obviously everything can be done manually but I'm looking for a more efficient solution. One challenge is that my pdf image needs to be re-sized separately to maintain scale of the image, the text frames just expand horizontally. What I would like is to have is a script that can do all of this at once, or is there a way to save the layout settings and apply them to my other documents? I have almost 300 documents to adjust... Can anyone suggest anything? Thanks.

    It could probably be modified to run on all open docs or a folder. You should ask over in scripting. InDesign Scripting

  • Multiple selected text frame to table

    I am looking for a script that will allow me to select multiple text frames at one time and have the contents in those text frames converted to tables.
    What I have to do now is place the cursor in one text frame, select all, select menu item "convert to table", the defalt dialog appears and I click ok.
    I have ten text frames on a page (for example). The manual process means I have to do the text to table 10 times per page.
    So, I would like a script that will allow me to select all 10 text frames and convert the content of each frame to a table.
    Any suggestions are appreciated.
    RPP

    This should do it:
    if (app.documents.length > 0 && app.selection.length > 0)
      for (i = 0; i < app.selection.length; i++)
        try {app.selection[i].texts[0].convertToTable ("\t", "\r")}
          catch (_) {}
    Peter

  • Is there a script that it can make Overflow text automatically routed Next?(Not the main text frame)

    Is there a script that it can make Overflow text automatically routed Next?(Not the main text frame)
    when I run the scrip,Overflow text can auto Typesetting to the next page?
    thankS Supreme~

    Here's the script I use. Notice the complications getting the live area when other than rulers per spread is employed. The script automatically selects the final selection point in the story and moves to that page in the active window.
    //DESCRIPTION: Autoflow selected overset story
    (function(){
              if (app.documents.length > 0
                                  && app.selection.length == 1
                                  && app.selection[0].hasOwnProperty("parentStory")
                                  && app.selection[0].parentStory.overflows) {
                        app.doScript(fixOverset, undefined, app.selection[0].parentStory, UndoModes.entireScript, "Fix Overset");
              } else {
                        alert("There must be a selection that identifies the overset story.");
              function fixOverset(story) {
                        while (story.overflows) {
                                  var aDoc = story.parent;
                                  var lastTF = story.textContainers.pop();
                                  var lastPage = lastTF.parentPage;
                                  if (lastPage instanceof Page == false) {
                                            alert("Story ends on pasteboard; no action taken.");
                                            return;
                                  var master = lastPage.appliedMaster;
                                  var newPage = aDoc.pages.add(LocationOptions.after, lastPage);
                                  newPage.appliedMaster = master; // may not be necessary
                                  var liveArea = getLiveBounds(newPage);
                                  var newTF = newPage.textFrames.add({geometricBounds : liveArea, layer : lastTF.itemLayer});
                                  newTF.previousTextFrame = lastTF;
                                  if (newTF.insertionPoints.length == 0
                                                      && lastTF.insertionPoints.length == 0) {
                                            // allows for paragraph style with startParagraph on specific page side
                                            alert("Story is permanently overset.");
                                            return;
                        selectIt(story.insertionPoints[-1]);
              function getLiveBounds(page) {
                        var rO = page.parent.parent.viewPreferences.rulerOrigin;
                        var bounds = page.bounds;
                        if (rO == RulerOrigin.spreadOrigin) return returnBounds(page, bounds);
                        var width = bounds[3] - bounds[1];
                        if (rO == RulerOrigin.spineOrigin &&
                                            (page.side == PageSideOptions.leftHand ||
                                                      (page.side == PageSideOptions.rightHand &&
                                                                page.parent.pages.length > 1)) ||
                                  (rO == RulerOrigin.pageOrigin &&
                                            page.side == PageSideOptions.rightHand &&
                                                      page.parent.pages.length > 1)) {
                                            bounds[1] = bounds[1] - width;
                                            bounds[3] = bounds[3] - width;
                        return returnBounds(page, bounds);
                        function returnBounds(page, bounds) {
                                  return [
                                            page.marginPreferences.top,
                                            page.side == PageSideOptions.leftHand ?
                                                      bounds[1] + page.marginPreferences.right :
                                                      bounds[1] + page.marginPreferences.left,
                                            bounds[2] - page.marginPreferences.bottom,
                                            page.side == PageSideOptions.leftHand ?
                                                      bounds[3] - page.marginPreferences.left :
                                                      bounds[3] - page.marginPreferences.right
               function selectIt(theObj) {
                        var myZoom = app.activeWindow.zoomPercentage;
                        app.select(theObj);
                        app.activeWindow.zoom(ZoomOptions.fitPage);
                        app.activeWindow.zoomPercentage = myZoom;

  • How to find a text in the Frame maker document via script?

    How to find a particular text in the Frame maker document via script?

    johnsyns wrote:
    Why it doesn't work for the other days? When i tried to change the days other than wednesday. it return nothing.
    Reason why Justin's code does not work for other days is date format mask DAY returns day blank padded to 9 characters which is the longest day name which, yes you guessed right, is WEDNESDAY. You either need to blank pad or use format modifier FM:
    SQL> select *
      2    from (SELECT TO_DATE(SYSDATE+ROWNUM, 'DD-MON-YY') dt
      3            FROM DUAL CONNECT BY ROWNUM <= 27)
      4  WHERE TO_CHAR(dt,'DAY') = 'TUESDAY'
      5  /
    no rows selected
    SQL> select *
      2    from (SELECT TO_DATE(SYSDATE+ROWNUM, 'DD-MON-YY') dt
      3            FROM DUAL CONNECT BY ROWNUM <= 27)
      4  WHERE TO_CHAR(dt,'DAY') = 'TUESDAY  '
      5  /
    DT
    07-APR-09
    14-APR-09
    21-APR-09
    28-APR-09
    SQL> select *
      2    from (SELECT TO_DATE(SYSDATE+ROWNUM, 'DD-MON-YY') dt
      3            FROM DUAL CONNECT BY ROWNUM <= 27)
      4  WHERE TO_CHAR(dt,'FMDAY') = 'TUESDAY'
      5  /
    DT
    07-APR-09
    14-APR-09
    21-APR-09
    28-APR-09
    SQL> SY.

  • How to enable the script label of a text frames in indesign using applescript

    hi all,
    am using Indesign CS2 with applescript..
    Using script I have to open a template in indesign and flow the word document into it...
    I can able to flow the word document into the template using "Place" command..but script labels of the text frames gets disabled...
    I need the script labels to be enabled...
    can anybody help me
    thanks in advance

    Script labels can't be disabled, so I'm not sure what your problem is -- perhaps seeing some code could help. Could it be that you're referencing a page item by label, but it is not responding because the item is part of a group?
    Shane Stanley <[email protected]>
    AppleScript Pro Sessions <http://scriptingmatters.com/aspro>

  • 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).

Maybe you are looking for