[CS4, JS] Text frame geometricBounds undefined

Hello,
I'm searching through all the paragraphs in a document for paragraphs with a particular paragraph style. When it's found, the script takes the geometric bounds of the parent text frame and uses them later. However, it doesn't work in some documents because the geometric bounds of text frames are undefined and cause an error. The error causing documents were originally PageMaker documents than have been opened through InDesign as saved as .indd. Documents created in InDesign run the script fine.
Anyway, here's the part of the script that's causing problems (I've tried iterating backwards and forwards, but to no avail):
myDocStories = app.activeDocument.stories
for (var i = myDocStories.length - 1; i >= 0; i--){
for (var j = myDocStories[i].paragraphs.length - 1; i >= 0; i--){
// Check each paragraph in active document for the chosen find paragraph or object style
if(myDocStories[i].paragraphs[j].appliedParagraphStyle.name == myFindParVal){
var myBounds = "";
myBounds = myDocStories[i].paragraphs[j].parentTextFrames[0].geometricBounds;
The weird thing is, if I select a paragraph that's found by the script and run app.selection[0].parentTextFrames[0].geometricBounds in the console...it tells me the bounds of the text frame.
I have literally no idea why it's doing this, but I suspect it's something to do with the fact that they used to be PageMaker files...

You are brilliant. A quick rejig of when the bounds are taken and it's fine again.
Thanks!

Similar Messages

  • Text disappearing from CS4 text frame.

    I work in a studio environment with multiple computers/users sharing files from the same server. Occassionally when I (or another user) opens an InDesign CS4 file there will be text missing from one or more text frames. The frame is still there, but it is empty. If I close the file without saving and then re-open it, the text may re-appear in that frame, but text may be missing from a different frame, or no text will be missing at all – seemingly a completely random occurrance. We have tried to resolve whether this happens with missing/conflicting fonts, but there seems to be no correlation. The problem is not repeatable, but happens at least once a month. We cannot narrow down any ther common denominators within the files.
    We run Mac Pros and iMacs, OS X 10.5.8 or later, InDesign Creative Suite 4, Suitcase Fusion 2 and we are running a Windows Server (sorry, no other details on that).
    Any help or suggestions would be appreciated.

    Thanks for the advice, folks.
    I have hidden text enabled and there is nothing in the frame. These are standalone frames – not linked to any other frames, so it wouldn’t seem to be a re-flow issue. My gut is telling me that it’s font-related, as we have MANY font conflicts between computers, however the issue sometimes occurs without the “Missing Fonts” alert appearing upon opening.
    Suitcase Fusion 2… Unfortunately that may be the culprit. Yet another reason to not like that product, unfortunately. I will research that line of reasoning and report back.

  • Why are InDesign text frames uneditable, or converted to outlined objects, when opened in CS4?

    When opening a CS3 Layout in CS4 to make client text changes, all the text frame box edges (on their appropriate layers) are shown as dotted lines, and none of the type is editable!
    I restored the old version, and opened in CS3 old version, and the same thing applies! Arggggh - there must be a frame preference that I don't know about or an instruction accidentally given.
    How do I convert the text boxes back to editable regions? Got a deadline and am miffed.
    I am a 20 year veteran of Pagemaker/Indesign/CS and this has never happened to me before!

    Dotted lines for frame edges means that the item is on the Master Page. That’s why you can’t edit items, because they are on the Master, not on the numbered page. Either Command-Shift-click on the object to edit it or edit it on the Master Page. You should find out why so much of the document was built on the Master Page. Either the designer meant this to be a template for multiple existing or future pages, or someone just wasn’t paying attention and didn’t realize they were designing on the Master.

  • CS4 editable master text frames in CS5 no longer editable

    Hi,
    Problem: Text frames on CS4 document pages (from locked text frames on masterpage) are no longer editable on CS5 document pages.
    CS4 situation:
    Masterpages contain text frames which are locked to prevent users from inadvertently moving them when working on document pages.
    On document pages, the text frames can be edited, i.e. text entered, but are position-locked.
    CS5 problem:
    When you now open the same document, the text frames on the document pages are totally locked, the positioning as well as the content. This means they are no longer editable! The only way I have found to make them editable once again is to unlock the text frames. But unlocking also removes the position lock.
    What do I have to do to get things working in CS5 like they were in CS4? Any quick solution or is this simply no longer possible?
    Confounded by InDesign once again...

    Yes, it works just like in CS4! Wunderbar!
    As I just had some trouble finding the where to change this setting,
    for anyone working with the German version of InDesign CS5:
    Menü: Bearbeiten > Voreinstellungen > Allgemein
    then under "Objektbearbeitung", remove the checkmark from "Auswahl von gesperrten Objekten verhindern"
    Thanks!

  • How do I unthread text frames in CS4 InDesign Mac?

    I've looked everywhere and tried what I found in Adobe help. I can't FOR THE LIFE OF ME figure out how to unthread text frames in InDesign CS4 [Mac].
    Please help. I know it must be simple.
    Thank you,
    Margot

    Run the SplitStory scipt thats in the samples in the scripts panel.
    A waord of caution, though. Splitting a threaded story caused ID to treat the text at the top of each frame as a new paragraph, even if it was caninued from a previous frame. This can result in unwanted changes like an indent, if such is called for in the paragraph style, or an extra number or bullet item in a list.

  • CS4 hungs after aborting text frame creation within command interceptor

    Hi all
    I´m using a command interceptor for cancelling any geometry modification to a locked -custom lock- document.
    The interceptor gets kNewPageItemCmdBoss commands and, if the document is "locked", aborts them by returning a ICommandInterceptor::kCmdHandled result. This works fine for image rectangles, lines, etc.Their creation gets canceled.
    The problem is with text frames; after aborting them, InDesign CS4 hungs.
    I guess there is another object creation related, that gets orphaned, but don´t know which. Any idea?
    Best regards

    I finally solved the problem.  Textframe creation involves many commands, and can´t be aborted in the  kNewPageItemCmdBoss phase. I used kNewFrameCmdBoss, and setting global  error within this change works, using only a document observer, without needing a command interceptor
    Regards

  • Assign text to a text frame Indesign CS4 JC

    Hi,
    I have a little challenge. I assigned text to a text frame many times, but the line wouldn't work now. Could you help me with it:
    try{
    var myNumber = app.activeDocument.selection[0];
    if (myNumber instanceof Rectangle){
        myNumber.fillColor = "White";
    catch (e){
    alert ("Please create and select Rectangle");
    exit();
    myNumber.contentType = ContentType.TEXT_TYPE;
    //myNumber = String ();
    myNumber.contents = "mamma";
    It wouldn't input my value into the frame (the pink line).
    Thank you very much for your help.
    Yulia

    //Try this
    if(app.selection.length>0){
        var myNumber = app.selection[0];
        try{
            if (myNumber instanceof Rectangle){
                myNumber.fillColor = "Paper";
        catch (e){
            alert ("Please create and select Rectangle");
            exit();
        myNumber.contentType = 1952412773;
        //Seems to have lost the reference to the Rectangle
        app.selection[0].texts[0].contents = "Test";
    } else {
        alert("No items selected");

  • Adding a Text Frame to an Existing Group

    I have belatedly discovered another difference between CS4 and CS2 -- I don't know whether this started with CS3 or not; I think perhaps it did.
    When you want to add a text frame to an existing group (which means create a new one within group), it's fairly straightforward unless the group is inline to a story. Then the new item gets added at the wrong place (I suspect what actually happens is that it always used to get added at the wrong place and then moved to the specified coordinates; but in CS2 and earlier, there was no automatic updating of the screen so the coordinates worked, but in CS4, the addition of the new frame moves the inline and so the coordinates you're aiming for are no longer correct). I worked around this in the following script by changing the anchoring and then changing it back -- I'm not entirely sure that this is foolproof, but it works on the job we're using it for.
    //DESCRIPTION: Add New TF to Parent Group of Selected TF
    (function() {
         if (app.documents.length > 0 &&
                   app.selection.length === 1 &&
                   app.selection[0].parent instanceof Group &&
                   app.selection[0] instanceof TextFrame) {
         var group = app.selection[0].parent;
         if (group.parent instanceof Character) {
              // we have an anchored group. Make sure it is custom while processing
              var origAncState = group.anchoredObjectSettings.anchoredPosition;
              group.anchoredObjectSettings.anchoredPosition = AnchorPosition.anchored;
         var bounds = app.selection[0].geometricBounds;
         var newTF = group.textFrames.add({geometricBounds:bounds});
         newTF.move(undefined, [0, -1]); // offset a pica -- or whatever the units are
         if (origAncState !== undefined) {
              group.anchoredObjectSettings.anchoredPosition = origAncState;
         app.select(newTF);
         } else {
              alert("Please select a text frame in a group.");
    Dave

    Open the PDF in Acrobat (not Reader).
    Use the "Draw Rectangle" tool (Comment :: Drawing Markups)
    Go into the Rectangle Properties to configure appearance for border line style, thickness and color; fill color and opacity.
    Be well...

  • How do I create a series of text frames using values from Excel list?

    First of all, this is the very first script I'm attempting to write from scratch. I'm completely green at scripting, and I've picked up a few snippets from Adobe's ID scripting guide, but nothing has really stuck yet relating to this particular objective.
    My supervisor keeps a master list of ad spaces, with the name of the account, how wide the space is, and how tall the space is, all in an Excel sheet. These spaces can number in the hundreds, and I am stuck manually drawing one rectangle for every space, which takes a very long time.
    I'd like to create/have help creating a script that will take these values and "automagically" draw these spaces in the form of text frames, with the width (in columns) and the height (in inches) defined by the values in the master list, as well as the name of each account appearing in the subsequent text frames.
    The script doesn't necessarily need to be able to pull the values straight from the Excel sheet; I can transfer the values to a support text file if needed, or directly into the script, changing it as I need it. A big thing (if it is not able to pull right from an Excel sheet) is that the number of spaces changes weekly, and so do the accounts, and the width and the height. Accordingly, it would be ideal if the values from the sheet could be changed easily, so as to create a new set of spaces as needed.
    Positioning for each space is not crucial, only height and width. If they all appear on top of each other on the same page, that will be a result for me. The main idea is to not have to draw them all manually, one by one.
    To me, this sounds like a tall order, but hopefully some experienced scripters out there can assist me, as I wish to become experienced as well.
    So, the TL;DR version:
    - Script needs to draw a series of text frames.
    - Text frames dimensions need to be defined by width and height values from Excel sheet.
    - Text frames must have account name as contents (from account names in Excel sheet).
    - Accounts, width and height change every week in the Excel sheet, so must be relatively easy to exchange all of the values.
    - The width values are on the Excel sheet as columns. It would be ideal if the script could convert those numbers into multiples of columns as needed.
    - (Optional) Script can pull values directly from Excel sheet.
    - (Optional) Script can define text frame fill color as gray. (If it works as I think it will, I could just select all the resulting text frames myself and set them all to gray at once... I'm not that lazy )
    Thanks in advance to whomever can assist in any possible way, even if it is just a push in the right direction. This script will save 1-2 hours of tedium every week.

    Sound like the perfect thing for InDesign Scripting.
    I would copy the Excel contents into a text file, to get a format that is easily read from InDesign, and there will automatically be a TAB for each "cell" just using copy/paste.
    Here is a piece of code, that you perhaps could go on with (adding variable to change pages and location on page, and other stuff).
    The readFileLineByLine function, can be easily re-used with any function using "callback". You simply supply the function to it, that you want to be executed for every line of text that is read:
    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 saved as UTF-8 and looks like this (showing hidden characters):
    Message was edited by: Andreas Jansson

  • How to create, place, format and paste the clipboard contents into a text frame

    I am new to scripting and need help. I have an existing Indesign document. I need to be able to create a text frame on my current page, the width of my margins with the top of the text frame at the top margin and 1" in height, then format it to be 1-column, and then paste the clipboard contents into it and tag the text with a particular paragraph style. I am using Indesign CS4 on a mac, if that makes any difference. Thanks for any help.

    May this will help you. It will create an anchored object with a text what you desired, with object style. You should create an object style before with the x and y co ordinates. You can choose either para style or character style.
    var the_document = app.documents.item(0);
    // Create a list of paragraph styles
    var list_of_paragraph_styles = the_document.paragraphStyles.everyItem().name;
    // Create a list of character styles
    var list_of_character_styles = the_document.characterStyles.everyItem().name;
    // Create a list of object styles
    var list_of_object_styles = the_document.objectStyles.everyItem().name;
    // Make dialog box for selecting the styles
    var the_dialog = app.dialogs.add({name:"Create anchored text frames"});
    with(the_dialog.dialogColumns.add()){
    with(dialogRows.add()){
    staticTexts.add({staticLabel:"Make the anchored frames from ..."});
    with(dialogRows.add()){
    staticTexts.add({staticLabel:"This character style:"});
    var find_cstyle = dropdowns.add({stringList:list_of_character_styles, selectedIndex:0});
    with(dialogRows.add()){
    staticTexts.add({staticLabel:"Or this paragraph style:"});
    var find_pstyle = dropdowns.add({stringList:list_of_paragraph_styles, selectedIndex:0});
    with(dialogRows.add()){
    staticTexts.add({staticLabel:"Leave one dropdown unchanged!"});
    dialogRows.add();
    with(dialogRows.add()){
    staticTexts.add({staticLabel:"Delete matches?"});
    var delete_refs = dropdowns.add({stringList:["Yes","No"], selectedIndex:0});
    dialogRows.add();
    with(dialogRows.add()){
    staticTexts.add({staticLabel:"Anchored text frame settings:"});
    with(dialogRows.add()){
    staticTexts.add({staticLabel:"Object style:"});
    var anchor_style = dropdowns.add({stringList:list_of_object_styles, selectedIndex:0});
    with(dialogRows.add()){
    staticTexts.add({staticLabel:"Frame width:"});
    var anchor_width = measurementEditboxes.add({editUnits:MeasurementUnits.MILLIMETERS, editValue:72});
    with(dialogRows.add()){
    staticTexts.add({staticLabel:"Frame height:"});
    var anchor_height = measurementEditboxes.add({editUnits:MeasurementUnits.MILLIMETERS, editValue:72});
    the_dialog.show();
    // Define the selected styles
    var real_find_cstyle = the_document.characterStyles.item(find_cstyle.selectedIndex);
    var real_find_pstyle = the_document.paragraphStyles.item(find_pstyle.selectedIndex);
    var real_anchor_style = the_document.objectStyles.item(anchor_style.selectedIndex);
    // Check if a style is selected
    if(find_cstyle.selectedIndex != 0 || find_pstyle.selectedIndex != 0) {
    // Define whether to search for character styles or paragraph styles
    app.findChangeGrepOptions.includeFootnotes = false;
    app.findChangeGrepOptions.includeHiddenLayers = false;
    app.findChangeGrepOptions.includeLockedLayersForFind = false;
    app.findChangeGrepOptions.includeLockedStoriesForFind = false;
    app.findChangeGrepOptions.includeMasterPages = false;
    if(find_cstyle.selectedIndex != 0) {
    app.findGrepPreferences = NothingEnum.nothing;
    app.findGrepPreferences.appliedCharacterStyle = real_find_cstyle;
    } else {
    app.findGrepPreferences = NothingEnum.nothing;
    app.findGrepPreferences.appliedParagraphStyle = real_find_pstyle;
    app.findGrepPreferences.findWhat = "^";
    // Search the document
    var found_items = the_document.findGrep();
    myCounter = found_items.length-1;
    do {
    // Select and copy the found text
    var current_item = found_items[myCounter];
    if(find_pstyle.selectedIndex != 0) {
    var found_text = current_item.paragraphs.firstItem();
    var insertion_character = (found_text.characters.lastItem().index) + 1;
    var check_insertion_character = insertion_character + 1;
    var alt_insertion_character = (found_text.characters.firstItem().index) - 1;
    var the_story = found_text.parentStory;
    app.selection = found_text;
    if(delete_refs.selectedIndex == 0) {
    app.cut();
    } else {
    app.copy();
    } else {
    var found_text = current_item;
    var insertion_character = (found_text.characters.lastItem().index) + 2;
    var check_insertion_character = insertion_character;
    var alt_insertion_character = (found_text.characters.firstItem().index) - 1;
    var the_story = found_text.parentStory;
    app.selection = found_text;
    if(delete_refs.selectedIndex == 0) {
    app.cut();
    } else {
    app.copy();
    // Make text frame from selection
    try {
    app.selection = the_story.insertionPoints[check_insertion_character];
    app.selection = the_story.insertionPoints[insertion_character];
    } catch(err) {
    app.selection = the_story.insertionPoints[alt_insertion_character];
    var the_anchored_frame = app.selection[0].textFrames.add({geometricBounds:["0","0",anchor_height.editContents,anch or_width.editContents],anchoredObjectSettings:{anchoredPosition: AnchorPosition.ANCHORED}});
    app.selection = the_anchored_frame.insertionPoints[0];
    app.paste();
    // Apply the object style now to "force apply" paragraph style set in the object style
    if(anchor_style.selectedIndex != 0) {
    the_anchored_frame.appliedObjectStyle = real_anchor_style;
    myCounter--;
    } while (myCounter >= 0);
    } else {
    alert("No styles selected!");

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

  • 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

  • Can you change a story or text frame's index? (re autonumbering)

    Does anyone know if there is a way to change the index of a text frame or story without changing the actual visual layout of an InDesign document? So far all I can come up with is to cut the frame and repaste it into the document. You can move a story within the index list of a document, but that visually cuts and pastes the story text.
    actDoc.stories.item(1).move(LocationOptions.BEFORE, actDoc.stories.item(0));
    I can't see any method to change the index of a text frame (other than cutting and repasting).
    I want to put together some tests. I have a bunch of questions. Each question is a single story in a single text frame in an InDesign document. The text frame is linked to an InCopy document. The first paragraph of the question has a "QuestionNumber" style but the para style has no numbering. I want to have only one version of each question (the InCopy story) but to put the questions into different tests in different orders with different numbering. What I do is to create an InDesign template for the tests that has a QuestionNumber para style that includes autonumbering with the "Continue Numbers across Stories" option checked. This works beautifully and the questions are numbered in the order in which the text frames (and stories) are (via a script) copied from the question document and pasted into the test paper document. When the same question/story/textframe is used in two tests it is numbered in the order in which it is pasted into each test paper (but the original stays the same because it has no numbering).
    The next step would be to be able to reorder the question numbers within the test paper (if you wanted to, say, swap questions 18 and 20). To do that you have to change the index of the story because the autonumbering across stories seems to depend on the index of the story.
    What seems to happen is that stories are indexed in the order in which they are pasted into a document, but text frames are indexed in the opposite order. If you paste a text frame with one story into a new document, it is textframe.item(0) and story.item(0). If you then paste a second one into the document it is story.item(1) but textframe.item(0). The first text frame becomes textframe.item(1). When you cut a text frame and repaste it, it is reindexed as if you were pasting it for the first time.
    The autonumbering also seems to be segregated by page. If you have questions 1 and 2 on page 1 and questions 3 and 4 on page 2, you can move around the text frames for 1 and 2 on the page but the numbering stays the same. Likewise for 3 and 4. If you drag 3 across to page 1 it stays as 3 but if you drag question 4 across to page 1 it becomes 3, and the original question 3 on page 2 becomes question 4. It is confusing but makes sense in a weird way once you get the hang of it.
    Anyway, I have probably answered my own question and the best way to renumber the questions in a test is to run the script again and create a new document using a new question order.
    But any other ideas are welcome.
    Thanks.

    hi Brian
    which version of InDesign you have ?
    I have checked these steps on CS3 and CS4:
    first I've set ON to option in preferences to preserve links when placing
    then I've placed DOC file as AnchoredTF in new Story
    then I've copied this AnchoredTF and pasted it on page, and then I've pasted it as another AnchoredTF - each time there was new lick created to the same DOC file
    then I've set OFF to option in preferences to preserve links when placing
    and even when I again copied and pasted this AnchoredTF with placed DOC file - it still add new link on Links palette
    so maybe with InCopy stories there is next bug or next "feature" ...
    [edit]
    ok - I've checked InCopy file - after exporting TextFrame as InCopy Story
    and it's like you've said - pasting on page - new link is created - pasting as Anchored - link isn't created ... no matter if option in preferences is set or not ...
    verdict - we've found new bug
    BUT ... if you link it again - by CTRL+D method - link is preserved even if option in preferences is set to off so you can have more than one InCopy Story placed as AnchoredTF in same parent Story ...
    robin
    www.adobescripts.co.uk

  • Master Text Frame for Page Heading

    Hello, I am new to indesign and using CS4.  Sorry if this is a newbie question.
    I am creating a pdf digital presentation and laying it out.  I want to create a consistent header on each page in the top left corner and ensure it is in the exact same location on each page.  I also want to make sure the text size, font, and color is consistent on each page.  Most importantly, if I need to change anything, lets say a font, I want to only do it in one place and not do it on all 20 pages in my document.
    My understanding is to add a text frame to the master page.  However, how do I edit the text on each page and not have it show on my cover page which is page 1 of my document?
    Thanks!!!!

    Create a text frame on the master page (make it wide enough and deep enough for the longest heading)
    Insert some generic text like "Heading"
    Give it a paragraph style
    Adjust the paragraph style to your liking
    Go to each page you want to change, and CTRL SHIFT (cmd shift on mac) and double click the "Heading"
    Change the text to what you want it to look like.
    To alter the text colour/font etc. for all of them - adjust the paragraph style
    To edit the text style for each heading so they look different in terms of colour etc. -  just change the Character Colour via the swatches.
    if you do this, then any changes to the Paragraph style should follow through on all pages - except where you've perhaps changed the character colour (or any other hand-adjusted changes to the text.
    Also - if you move the Text Frame on the master page they should all move on the corresponding pages, provided you haven't moved them by hand on the actual pages.

  • How can I simply create a text frame with perfect rounded ends?

    I'm recreating a new edition of a book that was originally created in Quark. It uses round-ended text frames. When using the simplest method of corner options, the ends aren't proper semicircles, even though the radius is set to half the height of the frame.
    The other problem is that I can't reduce the width sufficiently to make it look balanced. I use the direct selection tool to close in the right-hand end, so that I don't distort the shape. There's no right indent for the paragraph, but as I reduce the width the text breaks into two lines, even though I've greater space after the text than the left indent. My best solution was to create the shape in Illustrator and copy and paste into InDesign, assign text content, centre thte text vertically, use 3mm left indent. I still couldn't pull the right-hand end in tight enough. So I had to resort to making a group of the lozenge shape with a normal rectangular text frame on top.
    Does anyone know why these problems occur, and can Adobe improve the corner option?

    One last refinement: It's convenient if the script allows you to Undo/Redo its actions -- let me add that for completeness' sake. The following is the complete script again, no further editing required.
    //DESCRIPTION:Overlay round corners on a single textframe
    // A Jongware Script 2-Apr-2012
    app.doScript(function(textframe){
    if (textframe instanceof Group && textframe.pageItems.length == 2)
    roundedRect = app.selection[0].polygons[0];
    textframe = app.selection[0].textFrames[0];
    textframe.properties = {strokeWeight:roundedRect.strokeWeight,strokeTint:roundedRect.strokeTint,strokeColor:roundedRect.strokeColor};
    roundedRect.remove();
    app.selection[0].ungroup();
    left = textframe.geometricBounds[1];
    right = textframe.geometricBounds[3];
    height = textframe.geometricBounds[2] - textframe.geometricBounds[0];
    center = (textframe.geometricBounds[2] + textframe.geometricBounds[0])/2;
    radius = height/2;
    leftRounded = textframe.parent.ovals.add({geometricBounds:[center-radius,left-radius,center+radius,left+radius]});
    riteRounded = textframe.parent.ovals.add({geometricBounds:[center-radius,right-radius,center+radius,right+radius]});
    rectBetween = textframe.parent.rectangles.add({geometricBounds:[center-radius,left,center+radius,right]});
    roundedRect = rectBetween.addPath([leftRounded,riteRounded]);
    roundedRect.properties = {strokeWeight:textframe.strokeWeight,strokeTint:textframe.strokeTint,strokeColor:textframe.strokeColor};
    textframe.properties = {strokeWeight:0};
    app.select(textframe.parent.groups.add([roundedRect,textframe]));
    }, ScriptLanguage.JAVASCRIPT, app.selection[0], UndoModes.ENTIRE_SCRIPT, "Overlay Round Corners");

Maybe you are looking for

  • Cannot repair or erase external hard drive

    I recently purchased a Transcend 1TB harddrive and partitioned it in two. One of those partitions can no longer be mounted. I cannot repair the disk or erase it. I would be happy if I could completely erase the whole hard drive and start from scratch

  • Error while testing Generic Data Source extraction

    I've created generic data source for Texts and Attributes in R/3 based on VIEW (Z table) I get  error "Error 6 in function module RSS_PROGRAM_GENERATE" while trying to test the data sources through RSO2 I guess there can be a lot of reasons... Please

  • I can't export anymore pages file to pdf

    When I try to export pages file in pdf format (ever done without problems till few hours ago!) there is an alert advising me that files name having more than 31 characters can't be saved in the destination volume. But although I cut the lenght of the

  • Telnet or ssh management

    Hi Everybody!!! I have noticed that I can log in using almost every configured IP address on the device (here Catalyst 6500). I'm wondreing why? I'm not talking about source address, but the destination one. I have many vlan interfaces configured on

  • Deploying Reader 9.0 after Customization

    I have created an installer using the Adobe Customiztion Wizard 9. I have disabled things like auto updates, and EULA. I have also set it to be a silent install with no user intervention. I have exported it from the wizard, have the msi, mst file etc