[JS - CS5.5] how to put an image into a rectangle by its name?

Hello

I try to place an image into a rectangle of name...

myDoc var = app.activeDocument;

var myGraphicFile = File("/data/image.jpg");

This code work

myDoc.rectangles.item (0) .place (myGraphicFile);

or

IMG = myDoc.rectangles.item var (0) concerned (new leader (myGraphicFile));

This code does not work

myDoc.rectangles.item("Rec1").place (myGraphicFile);

or

var IMG = myDoc.rectangles.item("Rec1").place (new File (myGraphicFile));

You have an idea?

Thank you

Here's the function I use in CS5 +:

var myRec = GetItemFromCollection("Rec1", myDoc.rectangles);

function GetItemFromCollection(label, collection) {
    for (var i = 0; i < collection.length; i++) {
        if (label == collection[i].label) return collection[i];
    }
    return null;
}

Tags: InDesign

Similar Questions

  • How to put two images in an image on the windows photo gallery

    I need to know how to put two images in an image on the windows photo gallery.

    I need to know how to put two images in an image on the windows photo gallery.

    =================================
    If you say you want to join two images
    edge to edge that's easy to do with the free-
    Ware IrfanView.

    (FWIW... it's always a good idea to create a system)
    Restore point before installing software or updates)

    IrfanView and IrfanView plugins
    http://www.download.HR/download-IrfanView.html

    Once you have downloaded IrfanView and
    installed... Open the program and go to...

    ... Image / create the Image of the Panorama...

    Make your choice and click on the button create an Image.

    When you see the combined images displayed
    in the display... go to... File / save as...

    Choose a location...

    Choose a format...

    Give the file a new name...

    Click on... Save...

    Volunteer - MS - MVP - Digital Media Experience J - Notice_This is not tech support_I'm volunteer - Solutions that work for me may not work for you - * proceed at your own risk *.

  • How to put different images (image by record type) in native obiee table

    Hi, how to put different images (image by record type) in native obiee table?

    for example, the image is for the banana (record 1, row1)
    Picture B is for orange (record2, line 2)

    I know it's possible in mode narrative but I must manually apply CSS

    Thank you!

    Please take a look at this post on top of this message to activate the image column value interaction with target report i.e. (record 1, row1)

  • How can I insert image into the image in adobe first pro cc 2015

    How can I insert image into the image in adobe first pro cc 2015. I want to put a fixed image on a video sequence as a pip.

    1 import the photo into your project (CTL-I or just drag & drop in the project Panel)

    2 dag photo imported on your timeline in a track located above the video you already have.

    3. click the clip of the photo in the timeline panel and then click on the control panel of the effect of the Source Panel tab.

    4. here you can resize, move, and even rotate the picture of the "query" fixed effect.  You can use the sliders or click on the area next to the word "Query" and use your mouse to do everything from the program Panel.

    Good luck and have fun.  BTW: once you get it you like, you can even animate the PIP to fly in or any other movement, you can think of with keyframes.

  • How to insert multiple images into a file

    How to insert multiple images into a file

    Hi Mary,

    See this tutorial on adding images in Photoshop Mix and the grantor together: http://tv.adobe.com/watch/learn-photoshop-cc/combine-two-photos/

    Hope that helps,

    Concerning

  • How to load the image into the Blob field in Sql?

    Hello

    I want to know how to load the image into the Blob field in Sql

    Concerning


    Therese

    Re: How to load the image into the Long Raw column?

  • How to put the Image on health insurance for the elderly

    I wanted to know how to put pictures on health insurance for Senior related to my Web site.

    I am facing really problem loading page on my site due to a large image. I have really big senior insurance ( PII removed ) related 336 X 228 images to the right of my homepage. But the image is very large (size 445ko) this effect really on my problem loading page for google search engine.

    can someone tell me how to fix page load without removing my related image on my insurance for seniors Web site.

    Please let me know it will be appreciated.

    It is a picture of 11KO and does not cause a matter of charge time for you.

    Slow page loading can be caused by images that are hotlinked from another server that is slow.

    Consider removing it from your page. (it is useless)

  • " http://www.Copyscape.com/Web-Copyright-protection/" >http://banners.copyscape.com/images/cs-gy-3d-234x16.gif "ALT ="protected by Copyright Protection Copyscape Web"TITLE ="protected by Copyscape plagiarism Checker - don't copy this page." "WIDTH ="234"HEIGHT ="16"BORDER ="0">".

  • How to put an image in a specific location in an email?

    It is a more or less continuous PITA.

    When you reply to an e-mail message that includes all previous messages, often in my answer, I want to refer to an image. But I can't put the image there. He jumps just all the way up at the bottom of the thread of previous messages.

    In these discussions here, for example, I can insert a picture where I want. Like this:

    And then continue with the rest of my message, leaving the image where I want.

    Why the +++ * + §§ I can't do it in an email?

    I have no problem to drag / drop any image in one of my emails, Tom.   I wonder if in the implementation of e-mail you have missed something.

    http://News.sky.com/story/1634763/Shoreham-pilot-linked-with-previous-incident

    Of course, this is not.

  • How to put the image inside the image of the desktop

    Hi team,

    I'm on MAC and I wonder if you could please help by telling step-by-step how to insert the image inside the desktop image in Photoshop. Thank you much in advance.

    Basically what you are looking for, it's transform freely. I hope this video helps.

  • How to put an image in the background and Center my text?

    I am new to this, I thought it would be much easier, but I was wrong. I can't yet put an Image in the background and Center my text.

    To do precisely what that you are looking for, within the DW interface (no coding)...

    Background image

    1. open the page you want as the background on image

    2. click on modify > Page Properties

    3. under click appearance (CSS) the search for a button for BackgroundImage and choose a file from your defined Site

    Center text

    1 highlight the text you want to Center in Design view

    2. click on the button CSS in the Properties window (Ctrl + F3 if it is not open)

    3. choose one of the icons of alignment that is there found

  • How to find specific images by the number or the name of the image?

    I recorded some insights on my desktop and decided to get some of them. I went looking for them by the number of image (i.e., 18095749, etc.) and there seems to be no way to search for images, if you already know the name/number. How is it possible without going through all the images again looking for ones I want? Thank you.

    Search by image number is the best way. A very common mistake is that you have the correct image type unchecked in your search. Remember that all four types of images or at least not included three videos are checked.

  • How to add an image into multiple pages?

    Hello

    First, you should know that before this announcement, I dug into Google but couldn't find a solution.

    How to add an image in the footer of a PDF of size section, for example, 500pages? I won't add one by one in the same page, it is much too long.

    Is it possible to add it in the footer or any other alternative section, while I find myself with the same image in an exact position in all 500 pages?

    Thanks for your response

    Best,

    Eric

    In Acrobat 9, you can select "Document > add watermark ' or ' Document > Add Background" and select a file that has the image. You can adjust the location for your needs. It is available in other versions too, but I don't remember the exact menu items.

  • How to import an image into a Psd file using the codes?

    I'm trying to import an image into a psd file as a new layer, but I can't find the photoshop object method in visual studio 2010 object browser. Is it possible to make this work with vb.net codes?

    Any suggestion will be graduate!

    You can, like me, simply leave the scriptlistener plugin installed all the time. Really there no performance impact unless the log file are very large. I just keep an eye on the log file, and then delete it when it starts to get too big. Also there that you don't want the two newspapers js and vbs output set just one you don't want to read-only. Photoshop will Ingore it and only writing to that desired.

    If you do not want to uninstall the plug-in a quick way to do this is to rename it by placing a ' ~' at the beginning of the name.

  • How to put background image to another image on top of that.

    Hi all

    Please help me how to fix the background image to a screen on top of that I need to put other elements.

    I use this, but it does not work for me.

    It displays the background image to the item added to the screen.

    another part will show whitescreen.

    VFM VerticalFieldManager = new VerticalFieldManager (VerticalFieldManager.NO_VERTICAL_SCROLL) {}
                        
    protected void paint (Graphics g) {}
    Bmap bitmap = Bitmap.getBitmapResource ("background1.png");
    width int = bmap.getWidth (); / /
    int size = bmap.getHeight (); / /
    int w = Graphics.getScreenWidth ();
    int h = Graphics.getScreenWidth ();
    g.drawBitmap (0,0,w,h,bmap,0,0);
    Super.Paint (g);
    }

    good.

    You can mark the thread if it is resolved

  • [CS5] [JSX] How to put a video from a URL

    Hey everybody,

    I found a great help in this forum in the past, so I hope that someone can help me this time.

    I use Indesign CS5 on a mac. I write in Javascript.

    What I'm trying to do it dynamically puts a video from a URL.

    I thought I could do this by adding a rectangle, then instead of the rectangle a film and finally add the URL.

    It does not work. I'm lost on how to proceed.

    Here is the code that I hoped would do (just the relevant lines from a bigger script)

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

    myPage var = myDocument.pages.item (0);

    frameVideo = myPage.rectangles.add ({geometricBounds: [0, 0, 144, 144]});

    onlineVideo = frameVideo.movies.add ();

    onlineVideo.url = " " http://www.meffect.nl/rocvideo/91870.MP4 ";

    When I run this script, I don't get any errors, but the video in the URL is not loaded.

    Can I use something like

    onlineVideo = frameVideo.place (URL ("http://www.meffect.nl/rocvideo/91870.mp4"));

    It doesn't work anymore!

    I hope that this is at all possible... I think it is, as you can do it manually in InDesign too.

    Thanks guys,.

    Michiel

    Hey guys,.

    I just arrived at the office after a good night's sleep, so I thought, let's give it another shot.

    For some reason any my code works now. This is exactly the code I posted yesterday.

    I have no idea why it does not work then, but it works now.

    Weird, but I don't mind as long as he continues to work

    Thanks anyway!

    Michiel

Maybe you are looking for

  • I can't set up a new account with T-Mobile 4G

    I have recently buy a slate of 10 HD 3600 us with Android JellyBean and I was just the initial game upward. Instructions to set up a new account 4G with T-Mobile seem simple enough in the tutorial:http://WWW8.HP.com/us/en/ads/free-mobility/overview.h

  • LabVIEW installation problem

    Hi all I have created an installer in labview(). When I tested it in labview PC pre-installed. It works very well. But when I try it in a fresh PC. I created the installer by adding runtime, max and visa toolkit or. When I try to run the exe, it disp

  • Test Drive Unlimited! PLEASE PLEASE PLEASE HELP!

    Hi, my pc is Vista I installed TDU and installed the latest patch of 1.45 to 1.66. everything worked fine so far. I am now running windows 7 Home premium and I installed TDU. with version 1.45 everything works but I can not go online cause it tells m

  • LabVIEW 8.6.1 executable do not work

    Hello. I recently tried to build a LabVIEW 8.6.1, app but when I tried to run the application, I continued to get dialog boxes looking for a sub - vi which should have been included in the build. These are all the Basic VI I does not develop. I don't

  • access is denied. (0x80070005)

    Whenever I try to do a backup on my laptop and desktop with the dvd player, running vista home premium, I get this error message after a short time.  I am the only user on these, tried to run right and administrative rights with a click and disable a