[CS2] [JS] Resize anchored object...

Good morning:
I need help figuring out how to resize different objects that are anchored in text. They do have a script label on them.
For example I have an inline text box with the script label "gadget" that needs to be resized from 1 inch to 2 inches.
Is there away to do this by way of a script?
Thanks in advance!
Theresa

Hi Teresa,
This is a very basic example: it adds 1 inch to the width and height of the inline text frame with "gadget" label (I assume that it may occur only once in each story and measurements are set to inches). I wrote this on CS3 — don't have CS2 any more.
var myDoc = app.activeDocument;
var myStories = myDoc.stories;
for (i = 0; i < myStories.length; i++) {
    var myTextFrame = myStories[i].textFrames.item("gadget");
        if (myTextFrame != null) {
        var myGb = myTextFrame.geometricBounds;
        var myNewGb = [myGb[0], myGb[1], myGb[2]+1, myGb[3]+1];
        myTextFrame.geometricBounds = myNewGb;
Kasyan

Similar Messages

  • How to create Anchored Object (CS2)

    Hi,
    Indesign CS2(PC version)
    Javascript
    Any one help me, How to create Anchored object within TextFrame and inside anchor object i want to paste one image.
    by
    Sudar

    Hi Hemi,
    Sure--tell the insertion point to create the object. For example, to add a text frame:
    //Given a reference to an insertion point "myInsertionPoint"...
    var myFrame = myInsertionPoint.textFrames.add();
    Now you have a text frame anchored/inline in the story. Next, recompose the story containing the frame:
    myInsertionPoint.parentStory.recompose();
    ...and resize the frame.
    //Given a frame width and height "myFrameWidth" and "myFrameHeight"...
    var myX1 = myFrame.geometricBounds[1];
    var myY1 = myFrame.geometricBounds[0];
    var myX2 = myX1 + myFrameWidth;
    var myY2 = myY1 + myFrameHeight;
    myFrame.geometricBounds = [myY1, myX1, myY2, myX2];
    At this point, you can adjust the frame's anchored object settings (your settings will probably vary, but this should give you the idea).
    var myAnchoredProperties = myFrame.anchoredObjectSettings;
    myAnchoredProperties.anchorPoint = AnchorPoint.topLeftAnchor;
    myAnchoredProperties.anchoredPosition = AnchorPosition.anchored;
    //NOTE inconsistent "o" in "offset".
    myAnchoredProperties.anchorXoffset = 0;
    myAnchoredProperties.anchorYoffset = -13;
    Hope this helps!
    Thanks,
    Ole

  • Un Anchoring objects in Indesign CS2 Using Apple script

    Hi all,
    I need to Un achor the object. I have the script which will un anchor the Text Frames but in case of
    Rectangle i'm not able to unachor. My script will find out the Anchrored Text Frames and place its
    contents to its position and then delete the frames. I can find out the Anchored Rectangles but i
    cannot get its contents. Can anyone help me out to do this?
    Thanks,
    Jacintha

    Hi,
    I can select the page item ,If i ask for page items and its parent. but not getting its contents.
    -- aframe is text frames in document
    set Conts to paragraphs of page item i of aframe
    set contents of first insertion point of parent of page item i to Conts
    I need to get the contents of anchoring objects and place it in its position and then delete the anchoring object. Tried working on above code but not able to get its contents. Any solution?

  • How to move the anchor object in indesign cs2 using js?

    i can able to move the normal textframe and other objects but cant do this for anchor objects.
    syntex:  anchorobject.move([x value,y value],undefined,true)
    how to move the anchor objects?
    thanks
    subha

    Could it be that the anchord object in question won't move because you have it set to keep within margins which is preventing the move you're requesting? I've certainly run into that.
    I've also run into the situation where the object model thinks the anchored object is in one place when it is actually in another because of that same keep within margins option. In this case, a move will apparently not work because the move is invisible, it being completely outside of the margins -- although that only applies to relative moves, I think.
    Dave

  • IndDesign CS2 Anchored objects issue

    I am working on a 400 pg yearbook-like doc. I've got pictures with captions(grouped with paragraph and object styles)that need to stay with the text where I insert them. As I work though the pages inserting objects, they appear to adjust prior page layouts. The pages are set up with two columns of text and the text is set up to flow through all the pages of the document. Some of the grouped anchored objects span the entire width of the text box/column. There are also grouped anchored objects that only take up half the column width that don't seem to have the same affect on other pages as the ones that take up the entire column width. The grouped objects that do take up the whole column all go into their text listings at the same spot-at the end of a listing. Does anyone know what I am doing wrong or why these objects would affect prior pages and how I can stop them from doing that?

    Not sure what you mean by affect. If it's just a couple of lines turning differently on the previous page I would put it down to the Adobe Paragraph composer. Try changing the affected paragraph to Single Line Composer in the Justification dialog and see if that stops it?

  • Callouts and anchored objects - there must be a better way to do this

    I've spent a lot of time in the last six months rebuilding PDF files in InDesign. It's part of my ordinary responsibilities, but I'm doing a lot more of it for some reason. Because I'm sending the text of these rebuild documents out for translation, I like to keep all of the text in a single story. It really helps to have the text in "logical order," I think; when I'm prepping a trifold brochure, I try pretty hard to make sure that the order in which the readers will read the text is duplicated in the flow of the story throughout the ID document.
    So, I'm rebuilding a manual that has a 3-column format on lettersize paper, and it's full of callouts. Chock full of 'em. They're not pull quotes, either; each of these things has unique text. Keeping in mind that I'd like the text in these callouts to remain in the same position in the text once I've linked all the stories and exported an RTF for translation, what's the best way to handle them? What I've been doing is inserting an emptly stroked frame as an anchored object, sized and positioned to sit above the text that is supposed to be called out. When my translations come back, they're always longer than the source document, so as I crawl through the text, I resize the anchored frames to match the size and position of the newly expanded translated text, and then nudge them into place with the keyboard.
    There Has To Be a Better Way.
    There is a better way, right? I'm not actually too sure. If I want to actually fill those anchored frames with text, I can't thread them into the story. I suppose that I could just thread the callout frames and assign two RTFs for translation instead of one, but then the "logical order" of my text is thrown out the window. So, I'm down to asking myself "what's more important? reduction of formatting time or maintenance of the flow of the story?" If there's something I'm missing that would let me dodge this decision, I'd love to hear about it. The only thing I can think of would work like this:
    1) Duplicate callout text in the story with a custom swatch "Invisible"
    2) Create "CalloutText" parastyle with "Invisible" swatch and apply it to callout text
    3) Insert anchor for anchored frame immediately before the CalloutText content
    4) Send it out for translation
    5) While I'm waiting for it to come back, write a script that would (dunno if this is possible):
       a) Step through the main story looking for any instance of CalloutText
       b) Copy one continguous instance of that style to the clipboard
       c) Look back in the story for the first anchor preceeding the instance of CalloutText
       d) Fill the anchored object with the text from the clipboard (this is where I'm really clueless)
       e) Apply a new parastyle to the text in the callout
       f) Continue stepping through the story looking for further instances of CalloutText
    If this really is the only decent solution, I'll just head over to the Scripting forum for some help with d). Can any of you make other suggestions?

    In-Tools.com wrote:
    The use of Side Heads saves weeks of manual labor.
    Yup, Harbs, that is exactly what I was describing. If I use the Side Heads plugin to set up a job, will my clients get a missing plug-in warning when they open up the INDD? Will roundtripping through INX strip the plugin but leave the text in the callout? (My clients don't care if the logical flow of the story is broken; it's just me.)
    I'm just curious; seems like a pretty obvious purchase to me. I'll probably try to script a solution anyways, after I buy the plugin; that way I get to learn about handling anchored objects in scripts AND deliver the job on time!

  • Need anchored objects to be behind text

    Anchored objects have aways had lot of shortcomings for my workflow. One shortcoming I'd really like to see fixed in future versions of ID is the inability to choose for the anchored object to appear behind the text it is anchored with. Here are just a few uses that I can think of that would be helpful in my workflow:
    Creating numbered lists that have specialty art behind the numbers. To do this currently, you have to either do manual numbering and group it with each object and anchor the object with the number into the line of text or you have to keep the auto-number list and the objects for the numbers separate and manually reposition the number objects whenever the text reflows.
    Creating paragraph backgrounds that flow with the paragraph. Right now about the only way to do that is using the paragraph rules or tables which have severe formatting limitations (no rounded corners, ignore text wrap, etc.), and the rules are difficult to resize. If you could create the background as a ID object or placed art and anchor it to the beginning or end of the paragraph, you could manually resize it to the size of the paragraph and it will flow with the paragraph whereever you need it (this currently will not work unless the object can be made transparent to the text using an effect.
    Captioning anchored images could actually overlap the image if and where necessary. Right now, if you want captions to appear on top of an anchored image, you have to group the caption with the image before anchoring it into the text flow.
    There are workarounds obviously for these tasks (as I've indicated), but by their nature workarounds are time consuming. I'm always looking for ways to automate tasks and save time in ID. Having the option to make an object appear behind the text it is anchored with would be a tremendous time saver.
    Anyone else see a use for stacking order option with anchored objects?

    @Obi-wan – you say: "Despite the fact that, like all anchored boxes, it is foreground, text color is truly visible with no effect on the blue block !!"
    With anchoring "Above Line" the anchored objects are really stacked behind. At least that stacking order is true for all characters after the anchor character. Using a different anchoring method will always yield in anchored objects stacked above (foreground).
    Doing some tricks with the effects panel on the anchored object is alright, so that all the other text, that is stacked below will showing through, but you should be aware, that these effects will change the game when it comes to color separation for print workflows.
    Separation preview with all channels visible CMYK:
    Separation preview with [Black] not visible CMY:
    As you can see, the usually overprinting color [Black] on the text below is left out. When exporting a PDF, I think nearly no prepress tool in the world will find an automatic way to change this because of the stacking order of the elements.
    If the green rectangle would be stacked behind the text like in anchoring "Above Line" we will see the following with separation preview CMYK:
    Turn off K in the separation preview will give a surprising image:
    All black text, that comes after the anchor character will overprint, all text before will not. And that "will not" is definitive. If we look at the objects in Acrobat Pro after exporting to PDF, we will see that not overprinting characters "ut endis" in my little screenshot here are below the green rectangle, all characters following after the anchor are above the green rectangle.
    Here a screen shot from Acrobat Pro that will reveal the stacking order a bit (the transparent background of the page is shown as gray; an option in Acrobat Pro's view preferences):
    So in the end, "ut endis" will be printed with a total amount of color:
    0 Cyan
    0 Magenta
    0 Yellow
    100 Black
    Sum: 100%
    The "black" text following due to overprinting* (EDIT) will be printed with:
    75 Cyan
    5 Magenta
    100 Yellow
    100 Black
    Sum: 280%
    * AND of stacking order of course!
    All other black text will overprint as well, but there is no effect for the green rectangle because the text is stacked behind the rectangle.
    Uwe

  • Anchored Objects Disappear When Page Moved

    I'm working in InDesign CS2 in XP environment. I duplicated a page that contains anchored objects. It was page one; the duplicate page is now page 5. I modified the duplicate page 5. Now I want the altered page 5 moved into page 1 position.
    When I move the pages either by dragging or by right clicking on the page icon and using the Move Page command, all anchored objects on the page disappear. I also cannot release the anchored objects because the release command is disabled when I select an object with the selection tool.
    Any suggestions?

    I got your file, and after looking at it, it's probably better not to post it publicly. For the lurkers, it's a draft government document, not yet ready for release.
    Anyway, I took a look at the file, first in CS2 where it was created, and then in CS3 to see if it would behave differently.
    First, the anchored objects aren't really gone, just temporarily invisible. if you select the objects and move the page, you can still see the selection outline. It's some sort of screen display bug/glitch, I think, in CS2. Exporting to .inx didn't fix it, so I think it's not corruption, and it doesn't happen at all in CS3.
    The bad news is I have no way to explain what the problem is, or how to prevent it from happening. The good news is I found a way to make them reappear! Select the text frame with the selection tool, and change its stacking order. I tried Ctrl + Shift + [ to send to the back, and Ctrl + ] to bring forward, and both seemed to work, though it may make a difference where in the order they start out. If one attempt doesn't work, try again, or send all the way back or forward.
    For what it's worth, this is only a display problem. Even when the anchored objects are not visible on the screen they show in both printed and exported PDF.
    Peter

  • Illustrator thinks I want to resize an object...

    Hi, so this is an issue that really annoys me and I'm not sure if there's a solution for it and/or if someone has complained about it.
    Basically, if I make a small shape, something about 50x80px and I try to grab the shape to move it to a different location, illustrator just assumes that I want to resize the object and acts as if I grabbed the corner points. I specifically try to click away form the resizing points and it still does it. Its really annoying because the only way I can grab the object is by zooming in and making sure the cursor is now a lot smaller than the shape to move the object. The problem with doing this is that by zooming it forces me to scroll with the object to the place I want to be.
    When this happens, my cursor doesn't change to the 'resizing' cursor... the one with the 2 small arrows pointing opposite directions. It stays as the regular cursor.
    I am using the Illustrator CC updated to the latest as of this date.

    Vhalor,
    I believe it is safest to hold Alt/Option when you use the Direct Selection Tool, to avoid the danger of dragging only some Anchor Points.
    I wonder whether it is time for the list.
    The following is a general list of things you may try when the issue is not in a specific file, and when it is not caused by issues with opening a file from external media, see below. You may have tried/done some of them already; 1) and 2) are the easy ones for temporary strangenesses, and 3) and 4) are specifically aimed at possibly corrupt preferences); 5) is a list in itself, and 6) is the last resort.
    If possible/applicable, you should save current artwork first, of course.
    1) Close down Illy and open again;
    2) Restart the computer (you may do that up to at least 5 times);
    3) Close down Illy and press Ctrl+Alt+Shift/Cmd+Option+Shift during startup (easy but irreversible);
    4) Move the folder (follow the link with that name) with Illy closed (more tedious but also more thorough and reversible);
    5) Look through and try out the relevant among the Other options (follow the link with that name, Item 7) is a list of usual suspects among other applications that may disturb and confuse Illy, Item 15) applies to CC, CS6, and maybe CS5);
    Even more seriously, you may:
    6) Uninstall (ticking the box to delete the preferences), run the Cleaner Tool (if you have CS3/CS4/CS5/CS6/CC), and reinstall.
    http://www.adobe.com/support/contact/cscleanertool.html

  • Resize an Object via javascript

    Resize an Object via javascript
    How do I...
    I want to select an object in my document, onscreen, (an image, or text) then run a script that will discern the object selected, and show a dialog box that will allow me to input a sizing percentage for that object (with anchor corner/center)(Press enter and object resizes).

    No they don't.
    Acrobat may be bundled with Creative Suite collections but the APIs has nothing in common other than the use of JavaScript. CS apps use the ExtendScript system, Acrobat has its own internal API and an SDK for inter-application control.
    PDF is an end-destination format - the page content is not designed to be edited, so while there are tools in the user interface to allow touchups and corrections to page objects those features are not available for automation. The JavaScript engine does not have access to the low-level document structure, it can only see markup (comments and form elements) and a limited range of document properties.
    bdmasha wrote:
    They are all part of a suite of tools that share a common access to internal api's via scripting/programming languages.
    InDesign is not Photoshop is not Illustrator, but they have much in common when accessing their api's that Acrobat does not allow--and Acrobat is part of that Adobe suite.
    Thanks again.

  • New technique to place multiple anchored objects in InDesign story

    Hello,
    For a while I have been trying to figure out how to insert multiple anchored objects into an Indesign story. As far as I can tell, you cannot copy multiple objects that have already been placed in a document (such as a multi-page pdf) into an InDesign story, but must copy and paste them one-by-one into the story. This is a problem for a project I am working on where I want to have a large number of 340x52 pt pdfs to flow throughout a document in a master text frame interspersed with text.
    I have now found a solution for this issue that I thought I would share in case it would be helpful for anyone. It utilizes Automator actions for Mac OS X and Microsoft Word 2011 [2008 may work also, but I don't have a copy of that to test]; I am not good with scripting but perhaps similar solutions could be found for other systems and programs.
    1. If you want to place a multipage pdf within a text frame, first it into individual files for each page (with Acrobat Pro or pdftk or something similiar).
    2. Create an Automator service or program with the action "Create New Word Document". You can also use another automator action to save the document, or save it manually (to change the filename). In the finder, select the items you want, then run the service or drag them into the Automator program you have created.
    3. Place the word document into your InDesign story. Your items will now be anchored objects ordered in your text frame as they were in the finder.
    Please let me know if this is helpful or if anyone has suggestions for doing this process is a more efficient way. I am not sure, but it may be the case that this approach would only work on Macs, as I gather from this thread.

    I might note that I am using InDesign CS 5, and importing from a document stored in docx format.

  • Get textFrame by label returns null and anchored objects

    I have the following two functions:
    function getByLabel(page, label)
        for(var i=0; i < page.allPageItems.length; i++)
            if( page.allPageItems[i].label == label )
                return page.allPageItems[i];
    and
    Object.prototype.findItems = function(/*obj*/props)
        if( !('everyItem' in this) )
            throw new Error("Error: " + this + " is not a collection.");
        var ret = this.everyItem().getElements(),
            i = ret.length,
            e, p;
        while( i-- && e=ret[i] )
            for( p in props )
                if( (p in e) && e[p]===props[p] ) continue;
                ret.splice(i,1);
        return ret;
    In my page structure, I got one main text frame (the content area) and two vertical text fromes on the sides of the page. There is also a small box textframe on top of the page. All these textboxes EXCEPT the main text frame are ALL "ANCHORED objects". I had to make them anchored objects, eitherwise after importing data, the boxes would jump around. (Example, the small box textframe that is on the top would get moved to the content area textframe etc). Not sure if using anchored objects is the proper way to fix this.
    When I try to get the small box text frame, it does not work using the findItems (returns null) but it works fine with the getByLabel method. Why is that?
    The calling syntax is:
    for( i=0 ; i < doc.pages.length ; ++i )
            var page = doc.pages.item(i);
            var textFrame = getByLabel(page, 'lblSection' ); //This works
            //   var textFrame = page.textFrames.findItems({ label:  'lblSection' })[0]; This does not work, returns null
            if( textFrame != null )
                textFrame.parentStory.contents = "";

    (function () {
        // Per the InDesign Scripting Guide, app.activeScript is only
        // valid when a script is directly executed from InDesign, not
        // from the ESTK, so a try/catch block is recommended to handle
        // it.
        var d;
        try {
            d = app.activeScript.parent.parent.fsName;
        } catch (e) {
            d = Folder.appPackage.parent.fsName+"/Scripts";
            return d;

  • Text wrap in anchored objects

    In order to place text boxes relative to the spine, I have placed them as anchored objects.
    But now, these text frames do not respect text wrap setting from objects outside of the anchored object.
    I have made sure that ignore text wrap in text frame options is not checked.
    Is this a bug?
    And does anyone know a workaround?

    In order to make my design indifferent to later added pages, I have placed all text frames and graphic placeholders as anchored objects, positioning them relative to spine.
    When I now place an object on top of such an anchored text frame, text wrap is not working, even if i overide the master page item.
    The only work around I have found is to copy the respective text frame and make the original master page item unvisible.
    Is there not another way to to this?
    For me, the best would be another way of placing text and graphic frames relative to spine.
    Bus as soon as one overrides the master page item, the object is not placed anymore relative to spine if another page is inserted.

  • CS4 text wrap over anchored object

    Every time I place an anchored object (doesn't matter if it's graphic or text frame) and apply text wrap, Indesign freezes permanently and only solution is killing it via task manager.
    I opened CS3 file with anchored objects w/ txt wrap and the same freeze happens when trying to move, delete or apply different wrap settings to object.
    It never happened in previous version of ID on my machine.
    Any solution to this problem? Thanks.
    My PC conf.:
    AMD x2 2.7
    2GB RAM
    Vista 32bit

    The first thing to try is replacing your preferences.
    http://livedocs.adobe.com/en_US/InDesign/5.0/help.html?content=WSa285fff53dea4f86173837510 01ea8cb3f-6d1e.html

  • Anchored objects and first line in InDesign CS3

    Hi, thanks for reading. I know that when you want an achored object at the beginning of a text block to all push away ("wrap around") the text, including the first line, you have to put it into a line before that.
    What I don't like about it, is that I then have an empty first line and everything else is pushed one line down. Now I could move the whole textbox up, to fit to the rest of my layout, but that's not the way one should work in InDesign. Is there a way to get around the first line?

    T-
    Select the anchored object and put text wrap on it. Then select the anchored object and go to Object/Anchored Object/Options. Select Position: Inline and set the Y Offset to the negative number that aligns your text where you want it.

Maybe you are looking for