pageItems.ItemByName () removes the frame

I'm working on the script that does the following:

1 reads xml and gets two bits of data: NomComposant and componentText

2 iterates through the current InDesign looking for blocks of text document whose 'name' is equal to 'componentName.

3. If the script detects a frame on a page which corresponds to the "NomComposant" and add the block of text to text

4. If the script is not a qualification framework it will add the frame to the first page of the document.

In one of my functions, I have the following:

---

pageItemByName = docReference.pages.item (q).pageItems.itemByName (theComponentName);

---

'q' is the page being the document and "theComponentName" is the name of the image I'm looking for.

---

Problem

---

The above command ends up deleting the first image that is created.

For example if I have four components: head, body, subtitle, legend of the script will perform the following operations:

1. read the first component, through the three-page document that does _not_ contain blocks of text

2. not to find frames with the 'name' of the 'head' on pages

3. create the image on the first page with the 'name' of the 'head' and place the text in the frame

4. read the second component, look at the first page with the command above, delete the word 'head', creating a new framework called "subtitle" and put the correct text in the frame

5. the script will end its work and will have created four frameworks, deleted the first and the other three on the first page to the left.

This also happens if I create the framework four before running the script and the four frameworks are _not_ on the same page.

If the frames are on the same page everything works as expected.

I thought at first, I was just a reference or a variable in the code, but at this point, I'm a little puzzled

Any thoughts appreciated.

-Jeff


Here's what I did to solve this problem:

This, as noted above, the original call was:

---

pageItemByName = docReference.pages.item (q).pageItems.itemByName (theComponentName);

---

The idea here was that I could be lazy and just ask "NomComposant" and recover from the first mention on the page and use this reference. Clearly who did not work for me.

I went a different route and asked for the pageItems, counted them and asked each for his name.

Like this:

---

for (var m = 0; m< pageitemslistcount;="">

var pageItemsReference = pageItemsList [m];

var pageItemsReferenceName = pageItemsReference.name;

do stuff

}

---

With a little more testing of the image returned, this solves the problem for me. I don't know yet why the first try failed.

-Jeff

Tags: InDesign

Similar Questions

  • Remove the frame of a picture?

    I have an app where I need to place several controls of 200 x 200 pixels on the front.

    I would like to remove the standard border/frame so that only content is displayed.

    Use the image of the classic palette and use the Brush tool to paint the color of the transparent border (T).

    Ben

  • Remove the frame Above/Below TFP when the publication using Framemaker 12

    In the mapping of Style tab, it seems, there is no way to substitute the frame above the FMP or below the FMP in the Framemaker paragraph format. Is there a way to remove it when generating help files? I can find almost any attribute to be changed, but not those.

    The issue I am having is that some title styles and notes use the lines above and below paragraphs that are created from objects in the pages of reference. I want to exclude these lines from the help output. Does anyone know how to do this? I'd rather not delete Framemaker lines before the generation.

    Thank you

    Darren

    Found! Sort of. May not substitute the paragraph for frame Above/Below FMP style. But we can say the Style mapping not to import the Page Images of reference which solved my problem.

    In the publishing settings, open the Mapping of Style tab and open the Image section. Uncheck import reference Page of Images .

    Only downside to this approach is that you will lose all the images in the reference Page for the output. So, if you want to keep some but others do not, it will not work.

  • Remove the frame Script

    I have this function that is called by a framework. When I leave the framework it is always try to run the createWater function.  How to avoid the he doint that?

    FRAME SCRIPT

    createWater();

    Stop (l)

    FUNCTION

    Water Shimmmer;

    function createWater()

    {

    var bm:BitmapData = new BitmapData (water_MC.width, water_MC.height);

    var disp:DisplacementMapFilter = new DisplacementMapFilter (bm, new Point (0,0), 1,2,10, 60)

    var pt1:Point = new Point (0,0);

    var pt2:Point = new Point (0,0);

    var perlinOffset:Array = (pt1, pt2);

    stage.addEventListener (Event.ENTER_FRAME, onFrame);

    function onFrame(evt:Event):void

    {

    perlinOffset [0] .x += 1;

    perlinOffset [1] there = 0.1;

    bm.perlinNoise (45,9,2,50, true, false, 7, true, perlinOffset);

    water_MC.filters = [disp];

    }

    }

    You should not be the function onFrame nesting like you do.  Pull on its own.  Aside from that, if you want to stop this function you must remove the ENTER_FRAME listener at any time in the code where you make the transition to another frame.

    stage.removeEventListener (Event.ENTER_FRAME, onFrame);

    Maybe it's all what you need to do since this seems to be the only things that could continue to work after leaving the frame.

  • How to remove the frame of the screen on HP G62-340US

    I have a broken screen I want to replace but I'm not sure how to remove the framing safely. There should be a few screws at the bottom, but I don't see any. There are plastic flat points where I thought I'd find screws. This model don't live on the bezel, so burst you just off the coast at the base? I watched a few videos on the internet, and each similar to mine model has screws on the bottom.

    HP G62-340US

    Edit: The plastic parts is proved be stickers. I used a sewing needle to take them off.

    Hello:

    If you have not read the help manual, I suggest you do so.

    Please refer to Chapter 4 for R & R procedures component.

    http://h10032.www1.HP.com/CTG/manual/c02641795.PDF

  • How to remove the frame enclosing yellow?

    If I understand correctly,

    stage.stageFocusRect = false;

    will remove the bounding box around buttons in my yellow Flash application.

    However, it is throwing an error:

    TypeError: Error #1009: cannot access a property or method of a null object reference.

    There is an addiction that I need to import first?

    In addition, it is essential that I retain the possibility of having key event handlers (that's why the bounding box yellow appears).  If stage.stageFocusRect removes the option to use the key commands?

    If so, is it possible to keep the keypress commands and remove the rectangle enclosing yellow?

    Thank you

    you just need to wait that your display object is added to the display list before trying to make reference to its stage property.  That is to say, using the addedtostage event:

    this.addEventListener (Event.ADDED_TO_STAGE, init);

    private void init(e:Event):void {}
    stage.stageFocusRect = false;

    }

    /////////////////////

    and your step will be always sensitive to the events as usual.

  • Why remove the frame of the image placeholder in a lightbox also removes the image frame?

    When you try to replace the placeholder (i.e. the ribbed sheet) image in a lightbox so that I can paste a code HTML in there instead, after selecting the image frame and pressing 'delete' on my Mac, image shading also disappears, so I can't paste the HTML in there. In verisons them earlier, I could search with the cursor until I found him once again, but with the last update - it disappeared completely.

    The deletion of the image frame should not be a problem. The area of the container is where you want to put your HTML content. You can right-click the placeholder text ("Lorem ipsum") to select the container once again, then just paste in the code. Once you paste, you can drag it into the container to set how you would like to.

  • How can I remove the frame private on a folder in Windows XP?

    I scored a private folder and now I want to cancel this setting.  The screen sharing and security I cannot uncheck the box 'make private' - it is gray and inaccessible.

    Hello

    · The folder is located in a different user profile?

    · Logged in as an administrator of the computer?

    I suggest you to take possession of the file and check if it helps. You can check the link for the procedure: how is ownership of a file or folder in Windows XP: http://support.microsoft.com/kb/308421

  • Remove the table for a photo table control framework

    Hello

    I need to create an array of 2D images. Due to the large amount of elements in the array, the width of the image is reduced to a minimum. However there are still a considerable gap between the 2 adjacent elements in the table (see the attached example), which is caused by the picture in the image control.

    I tried to affect the color of transparent photo frame, but even if it is invisible, it is still there. I tried to customize the control too, but I couldn't find a way to remove the framework (for classic and modern styles).

    (BTW, for the control of classical style, there is an option without color box control framework, but no option for 2D image control.) I need model/photos inside the element of control 2D image, so simple color 1 color box is not enough)

    Could someone help to suggest a way to remove the frame and optimize the density of space in the table? Thank you much in advance.

    PJI

    Hello, PJI,.

    You should be able to define the lower field in the area of the image of the control.

    -Right click Control and choose "Advanced Properties"-> "Customize.."

    -To the editor change order to 'Edit Mode'

    -from the menu, click on 'Window'-> 'display the parts.

    -In the part window, select the frame

    -set new values for top, left, height, and width, so that the image is behind the area of the photo

    I hope this helps.

    UliB

  • How to remove the rear work plan in photoshop CS6

    Hello

    I'm trying to find how to remove the rear work plan in photoshop CS6?

    I always looking for the "preference", but I can't find the solution.

    I really prefer to have no background as the CS5 because I always work with "drag & drop" and now, it is impossible to see my office.

    Capture d’écran 2012-03-28 à 11.15.15.png

    Thank you

    Concerning

    You could ask on the cs6 forum, but I think thre an option under window or view to remove the frame of the application.

    http://forums.Adobe.com/community/Labs/photoshopcs6?view=discussions&start=0

    I have a question if you don't mind. What resolution is your screen?

  • How to remove the Manager package SCORM framework?

    Does anyone know how to remove the frame of package SCORM (or TOC?) Manager of a multi-SCO project I create?

    I've attached a screenshot of what I mean.

    Thanks for your help!

    Kind regards

    If I'm not mistaken this framework is a product of the LMS and not Captivate. Arrange for having the content with LMS people launched in the desired frame type.

    HTH,

    Mike

  • How can I remove the imported tables frame color?

    Hello. I imported my Word document that has a table. Everything looks great, but when I export to PDF format, the table box is gray. I want the table to show.

    I don't want to have to re - create the entire table with text boxes, so I wonder if I can just remove the color of the frame?

    Thank you!

    You are welcome.

    Please remove your personal information when you respond by e-mail. Thank you.

  • Removing the radio button frames?

    I have a PDF file with radio buttons that the user can interact with however I can't find a way to hide the images radio button for when the customer uses the document no later than:

    acro.png

    Is there a way to hide the button 'frames '? Set a property? "Flatten" / convert the PDF to another format? Cover the frame with a layer?

    Another possibility is to align the framework to the design of box to hide but to show the overflow of the box for a fix font size? That would give the same glyph of large box in a small radio button setting.

    Any ideas please?

    Thank you

    Mark

    Thank you. I found the answer.

    It's actually 'Style' > Inset causing the framing thing to show. These options are disabled if you select 'No Color' for border and fill. Change a color, then change the style "Solid" line, and then changing the border to "No Color" removed the "framing". Clumsy

  • remove the overlay for ContentType.unassigned

    Hi Forum,

    I attributed to remove the overprint fill "pageItems or splineItems, but it does not work the bottom of case...»

    How can I remove the overprint fill to the contentType.unnassigned.  Here is my script...

    var doc = app.activeDocument;

    var items = doc.pageItems;

    list var = []; List unassigned frames

    for (i = 0; i < items.length; i ++) {}

    If (items [i] .contentType is ContentType.unassigned)

    Items [i] .overprintFill = false;

    }

    The scale is placed as a character inside the cell.  When selected the text tool no overprinting appears. but when he is selected as frame of overprint fill is shown... Please see the selected inside the image...

    Screen Shot 2013-02-12 at 10.39.50.gif

    I also tried with this method...

    try {}

    table = app.activeDocument.stories.everyItem ().tables.everyItem ();

    tcolors = table.cells.everyItem () .everyItem ();

    for (i = 0; i < tcolors.length; i ++) {}

    TColor = tcolors [i];

    If (tcolor.fillColor.name == 'Pantone 357') {}

    tcolor.overprintFill = false;

    }

    If (tcolor.fillColor.name == 'Pantone 357') {}

    tcolor.overprintFill = false;

    }}

    }

    catch (e) {}

    Thank you & best regards,

    ATLAST, I found it... Here is the result!

    myDocument var = app.documents.item (0);

    app.findObjectPreferences = NothingEnum.nothing;

    app.changeObjectPreferences = NothingEnum.nothing;

    app.findObjectPreferences.overprintFill = true;

    app.changeObjectPreferences.overprintFill = false;

    myDocument.changeObject ();

    app.findObjectPreferences = NothingEnum.nothing;

    app.changeObjectPreferences = NothingEnum.nothing;

    Thank you Forum...

  • HOW TO REMOVE A FRAME TO A PICTURE OF HER.

    HOW TO REMOVE A FRAME TO A PICTURE OF HIM.

    Hi, Katby,

    Place your cursor on the image you want to make a picture, so that it displays in the preview window.   Then it spread, as an 'image' on your desktop.  File > share > Image.

    Another way is to take a screenshot of the image in the preview window, which will place a .jpg of the framework file on your

    desktop computer.     You can do with this pressing command + shift + 4, and who will turn your cursor cross

    You can expose the pic with pressing your pad mouse or track that you drag in the photo.

    I hope this helps.

    -Rich

Maybe you are looking for