How do I align a placed image in a frame using JS?

I am new both to javascript and to scripting for InDesign, so please bear with me on this question.
I am trying to align an image in a graphic frame so it aligns to the top right corner of the frame.
I can do this using the InDesign interface by following these steps:
1. Create a rectangular frame.
2. Right-clicking the frame and selecting "Fitting > Frame Fitting Options."
3. Selecting the top-right square in the "Alignment" area of the Frame Fitting Options dialogue.
For me, this automatically aligns the image to the top right corner in the selected text frame, even if there is a placed item in the frame.
I am trying to apply this to the actual image frame using the following code where "modelFrame" is the rectangle that is the parent of the placed image:
          modelFrame.frameFittingOptions.fittingAlignment.anchorPoint = AnchorPoint.TOP_RIGHT_ANCHOR;
I am not getting an error, but I am also not getting the desired results (in fact, it doesn't change anythign at all). What am I doing wrong?

Hi lanejd,
I have got the same issue as you but had just found the solution. Please see below:
modelFrame.frameFittingOptions.fittingAlignment.anchorPoint = AnchorPoint.TOP_RIGHT_ANCHOR;
This will only set the properties for the Frame Fitting Options. You will need to call a method/function. Add the below line to your script and it will execute the Frame fitting Options.
modelFrame.fit(FitOptions.applyFrameFittingOptions);
Hope this help!

Similar Messages

  • How do you create a still image from a video using IMovies 11?

    How do you create a still image from a video using IMovies 11 on a Pro Mac?

    The simplest way is to do a simple screen capture.  

  • How do I make a placed image the full width of the browser?

    Hi, I've tried adding the image as the browser fill only to have it shuffling all other placed objects out of wack.
    I've also tried having it as a placed object but, when I preview in browser I can't seem to be able to get it the full which of the screen.
    my website is 1000 px wide, the image I'm trying to place in it is 5147x2668

    Thanks for the response Vivek,
    Tried that but no joy, it seems I've tried everything I can think of. I tried setting the the image as a browser fill. Very confused. It actually seems to be something to do with the page width or something. Using your method I successfully got the menu bar and the 100% width placed image the same width (previously they were different width's), but my whole site, when previewed just isnt the width of the browser. I must say I'm lost, I've tried changing the site properties (page width, margins etc.) I'm new to Muse but have studied it quite thoroughly over the last 6 weeks. Now I'm ready to build my site I seem to have tripped at the first hurdle here's a screenshot of what I'm getting when veiwed in a browser, as you can see it's all a bit shrunk down:
    and what I'm seeing in Muse's design page:

  • How do I create a disk image for windows 7, using a windows computer for USB bootcamp for mac?

    Hi There, I have just bought a new 2013 iMac.
    Spec: 3.4 GHz intel core i5, 16GB 1600 MHz DDR3 Memory , NVIDIA GeForce GTX 775M 2048 MB Graphics with OS X 10.9.4.
    How can I create a 'disk image' from a windows 7 professional 64bit installation DVD using a windows laptop with windows 7 Operating system on? I want to transfer this 'disk image' (ISO?) to a USB ready for installing windows onto my 2013 iMac using bootcamp?  I want to use bootcamp from a USB as I have no disk drive for the installation DVD on my iMac. I hope all this is clear.
    Thank you. Joe

    Yes, that's correct, at least not directly. You can create a blank disk image, copy the file to the mounted disk image, then burn the image to a CD/DVD.
    Open Disk Utility and select Blank Disk Image from the New menu. Provide a name, Save location, and select the image size from the drop down menu. Leave Encryptions at None and Format as read/write. Click on the Create button.
    After the image file appears the "removable" disk should be automatically mounted. If not double-click on it to mount it. A "removable" disk icon will appear. Drag the file you want to place on the disk image to the "removable" disk icon. The eject the "removable" disk icon. Now select the disk image file in the DU left side list and click on the Burn icon in the DU toolbar. Be sure to have a blank disc ready.
    The above is actually the "long" way to do this. A much easier way is to simply insert a blank CD or DVD into the optical drive. The Finder will pop up a dialog asking what to do. Select the option to mount on the Desktop. You will now see a disc icon on the Desktop. Drag the file you want to burn to the CD/DVD, right-click or CTRL-click on the disc icon and select Burn from the contextual menu.
    Why reward points?(Quoted from Discussions Terms of Use.)
    The reward system helps to increase community participation. When a community member gives you (or another member) a reward for providing helpful advice or a solution to their question, your accumulated points will increase your status level within the community.
    Members may reward you with 5 points if they deem that your reply is helpful and 10 points if you post a solution to their issue. Likewise, when you mark a reply as Helpful or Solved in your own created topic, you will be awarding the respondent with the same point values.

  • How to get UIDRef of placed image item.

    Hi All,
    I am making a plugin for InDesign CS3 and CS4. And I have a issue how to het UIDRef of  pageitem. Senerio is as follows,
    1. Place a image in non selected frame on Document.
    2. Place a image from drag and drop in InDesign Document.
    After placing the image on document, I need the UIDRef of this page item.
    I do the following for achieving it.
    1. Mae the DocObserver.
    2. When a page item is created, I get a call in DocObserver::Update() function for kNewPageItemCmdBoss and kAddToHierarchyCmdBoss.
    3. But I am not able to get UIDRef of PageItem by  this.
    If any one have any idea of it, then please let me know.
    Regards,
    Jitendra Kumar

    Jitendra:
       While not specifically addressing this problem, I have obtained the UID (and then derived the UIDRef) of an image by getting the hierarchy interface of the container and then getting the child.  This is a snippet of the code:
        UIDRef ItemRef = UIDRef(db, ItemUID);  //  ItemUID & db (IDataBase *) passed into function; db
        InterfacePtr<IHierarchy> iHierarchy(ItemRef, UseDefaultIID());
           if (iHierarchy != nil)
              if(iHierarchy -> GetChildCount() > 0)
                 UID imageuid = iHierarchy -> GetChildUID(0);
    HTH.
    R,
    John

  • How do i get a placed image to appear as image inside a layer?

    There is a long winded reason why I want this, but in essence I am trying to replicate another artwork that has been supplied to me.
    When I place a Photoshop image (TIFF / PSD etc) how can I get it so that it simply appears as <image> inside the relevant layer (screen shot attached)
    I am finding that when I place an image I do not get this

    That's what I had assumed. It just doesn't seem to be working for me. You don't think there is a Preference setting that might disable it?

  • Centre aligning images within picture frame using XML file

    Hi
    I am using a flash file that uses an xml file to upload a
    series of images one at a time into a picture holder.
    There are two different widths of the images. The height is
    always the same. Is it possible to set this up so every image that
    the xml file calls is centre aligned within the picture frame.
    At the moment when using the xml file to load the image it
    always left aligns the image when it brings it into the picture
    frame even if you change the alignment to centre align within in
    the align panel.
    Does anyone have a suggestion why this is happening or how to
    fix it?
    Thanks for the help

    You're welcome. Pleased it worked.
    All it does is use the MovieClipLoader class to load the
    images into your holder_mc. Because loading takes time, and because
    you can't check or adjust the size or position of images until they
    have loaded, the MovieClipLoader class gives you a handy option to
    run some code whenever its finished loading something you told it
    to load.
    That's what the addListener instruction does... it says
    whenever myLoader has something new to tell me about the status of
    the load requests I ask it to do... make it run some related code
    in the listener object (which is called loadListener in this
    code... it could equally be called something else). You 'listen'
    for different events or updates of status. All I 'listened' for
    here was the onLoadInit event.
    The onLoadInit is the 'final' status update after loading. It
    occurs when something has loaded and its properties are accessible
    (_x, _width etc). The target_mc that is an argument for the
    loadListener.onLoadInit is a reference to the clip that was loaded
    into.
    The best way to learn about this stuff is probably to read up
    on MovieClipLoader in the livedocs and try google to see if there's
    an online tutorial somewhere. Then give it a try yourself in
    another new fla.
    cheers
    GWD

  • How to request - Updating an embedded image in a PDF using Actions but not all actions are recorded

    i am trying to create an Action in CS3 but some of my actions are not been recorded.
    What i want to do is run the Batch option on a folder with a 1,000 PDFs in it. The PDFs
    (which were created in Illustrator CS3) consist of a single page with a single embedded
    image at the foot of the page. I am trying to update that embedded image.
    The Actions i am trying to record are...
    1) Select the single image in the Links palette.
    2) Choose the "Relink.." option in the drop down menu of the Links palette.
    3) Navigate to the new image and select "Place".
    4) Save and close document.
    But the first two actions are not been recorded.
    How do i get around this problem ?
    Note: From trying this manually the new image seems to take on the horizontal and
    vertical scaling of the previous image which is what i want. But if i am going to have to
    do a script then that is a factor that may have to be incorporated into the script.
    Any help appreciated.

    Give this a trial… It does a save as which is much safer than overwriting… At least you still have your originals should I get something wrong…? I did test but only with 3 files…
    #target illustrator
    function replaceImage() {
              var i, doc, fileList, inFolder, outFolder, opts, pic, rep, rip, saveFile, uIL;
              inFolder = Folder.selectDialog( 'Please choose your Folder of AI PDFs…' );
              outFolder = Folder.selectDialog( 'Please choose a Folder to save AI PDFs in…' );
              pic = File.openDialog( 'Please choose your replacement Image…' );
              if ( inFolder != null && outFolder  != null && pic != null ) {
                        fileList = inFolder.getFiles( /\.pdf$/i );
                        if ( fileList.length > 0 ) {
                                  uIL = app.userInteractionLevel;
                                  app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
                                  for ( i = 0; i < fileList.length; i++ ) {
                                            doc = app.open( fileList[i] );
                                            rip = doc.rasterItems[0].position;
                                            rep = doc.placedItems.add();
                                            rep.file = pic;
                                            rep.move( doc.rasterItems[0], ElementPlacement.PLACEBEFORE )
                                            rep.position = rip;
                                            rep.resize( 31.414, 31.414, true, true, true, true, 100, Transformation.TOPLEFT );
                                            doc.rasterItems[0].remove();
                                            rep.embed();
                                            opts = new PDFSaveOptions();
                                            opts.pDFPreset = '[Illustrator Default]';
                                            saveFile = File( outFolder + '/' + doc.name );
                                            doc.saveAs( saveFile, opts );
                                            doc.close( SaveOptions.DONOTSAVECHANGES );
                                  app.userInteractionLevel = uIL;
                        } else {
                                  alert( 'This Folder contained NO Illustrator PDF files?' );
    replaceImage();

  • How to print multiple custom size images on one sheet using PSE 10.

    I am running Photoshop Elements 10 on Windows 7/64 bit.
    I want to print six 2.5 inch by 1.75 inch images of one photo on a single 8.5 inch by 11.0 inch sheet.
    How do I do that?

    greenecar,
    Use the crop tool to crop the image to 2.5x1.75", with resolution 240px/in. Enter these values on the tool's option bar, then drag out the crop shield, and comit.
    Go to File>New>blank file, enter 8.5x11", background white (or anything else to suit), resolution 240 px/in. This will be your canvas
    Go back to the cropped image, go to Select>all, then Edit>copy to put it on the clipboard
    Open the canvas from Step #2
    Go to Edit>paste. Do this 5 more times. You should see 7 layers in the layers palette: The background layer (canvas), and 6 layers with the cropped picture
    Use the move tool to position the 6 ;pictures, one layer at a time
    You can go to View>Grid to open the grid to help with orientation. It will not print

  • How do I align a drop down menu in Firefox (using HTML)? My site works in Chrome and Explorer how I want it to, but not Firefox.

    There are 2 issues that arise in Firefox but not other browsers.
    1. The "All Categories" drop down menu is not aligned with the search field and search button.
    2. The company logo appears pixelated.
    The website is www.fortune3.com/evereadyhardware
    Please view in Firefox and in Chrome to note the differences. Thank you.

    Try posting at the Web Development / Standards Evangelism forum at MozillaZine. The helpers over there are more knowledgeable about web page development issues with Firefox. <br />
    http://forums.mozillazine.org/viewforum.php?f=25 <br />
    You'll need to register and login to be able to post in that forum.

  • How can I set the desktop image for client computers?

    How can I set the desktop image for client computers using ARD or terminal?

    How can I set the desktop image for client computers using ARD or terminal?

  • Placing images at an exact scale in Indesign CS5?

    Hi all,
    I'm hoping someone can clue me in here... I've just updated from Indesign CS3 to CS5. I was hoping in the upgrade Indesign would give you an option for placing images in picture frames at an exact scale (like you can in Quark), for instance if you place an empty picture box on the master pages and enter 55% scale you would drop in images on each page of the layout at 55% scale.
    In Indesign CS3 the closest I could get to that was to place an "FPO" image in the picture boxes on the master pages at 55% scale, then when I'd replace each FPO on the layout pages with my images they would drop in at 55% scale. It worked pretty well.
    With CS5 I'm finding that when I replace an FPO image it will still drop in at the same scale the FPO is at, but ONLY if you load and place one image at a time... if you load, say, twenty images and drop them into the layout replacing the FPO images, they come out as prorortionally fitted to the picture frame... NOT as 55%.
    this is a real issue for me as I routinely work on layouts where I need to place 400 and up images at an exact scale...
    Anyone know a work around here, or any tips?
    Thanks in advance.

    As far as I know, you can't set scaling for a empty frame. You can use a placholder image and scale that, and if you turn off relink preserves dimensions relinking to a new image would preserve the scaling, but only if you do it one at a time through the links panel. Using the Place command and replacing theimages will not preserve the scaling, so through the interface there isn't much help.
    On the other hand, I think this could be scripted. If you need all the images to be the same scale it should just be a matter of looping through the document images and setting the scale. If none of the scripters are taking notice here, ask over in the scriping forum.

  • How to split Windows Vista DVD image?

    I would like to ask how to split windows vista DVD image into specific size using Windows PE Tools Command Prompt.
    Thanks in advanced.

    Hi,
    You can try the following method:
    1.   Install UltraISO and Windows AIK.
    Windows AIK:
    http://www.microsoft.com/downloads/details.aspx?FamilyID=94bb6e34-d890-4932-81a5-5b50c657de08&DisplayLang=en
    2.   Use UltraISO to open the Windows Vista DVD and extract install.wim under the Sources folder to the local hard drive, for example: D:\Vista\sources\install.wim.
    3.   Run Windows PE Tools Command Prompt in elevated mode and type the following command:
    imagex /split D:\vista\sources\install.wim D:\temp\install.swm 380
    Note: D:\vista\sources\install.wim is the name and location of the file which will be split from. D:\temp\install.swm is the name and location of the target file. 380 is each target file size.
    Note: Before doing this, make sure partition D has at least 5GB of free disk space.
    After that, you will get 6 target files named install.swm, install2.swm, install3.swm, install4.swm, install5.swm and install6.swm in D:\temp.
    4.   Use UltraISO to open the Windows Vista DVD. Delete install.wim under the Sources folder and drag install.swm to this folder. Save the whole disk to the local hard drive and we will get CD1.
    5.   Open UltraISO and create a new folder named Sources. Drag install2.swm, install3.swm, install4.swm, install5.swm and install6.swm to the Sources folder. Save install2.swm to the local hard drive and we will get CD2. Use the same method to create CD3, CD4, CD5 and CD6.
    6.   Burn the iso files to CDs.
    The steps above can be a little complex. I recommend obtaining a DVD drive to install Windows Vista.
    Hope it helps.
    Tim Quan - MSFT

  • FCP 10.1.3 multiple graphic images into one frame

    Hi - How do I put multiple graphic images into one frame? - so it kind of looks like a video wall - except these are still images. I can do it manually but it's not precise. Anyone found a way other than this? Thanks.

    Here is my quick and dirty generator called "9 Pictures": https://www.dropbox.com/s/92c536wgesh2yzj/9%20Pictures.zip?dl=0
    To install it, unzip the file and place the folder inside /Users/yourname/Movies/Motion Templates/Generators
    It will look like this in FCP X. You just have to click each drop zone icon in the inspector and then select the desired clip from the browser. Use the Pan and Scale controls in the inspector to select which part of each image you want to use. Note: this was done in the hope that it may be helpful, but it is no more than a quick thing. You can also control-click the generator in the generator browser and choose open in motion (if you have it) to see how it was done and to modify it.

  • How do I position to panels in a single frame?

    Hi,
    Can someone tell me how i can position two panels in a single frame using the BorderLayout class.
    I have included my code below. When it is run it shows two JPanels positioned at the top and the bottom, a text area to the right, a panel in the center and a panel on the left. I want to get the panel on the left - the yellow panel - to be positioned in the lower third of the center panel. I have tried to use the BorderLayout.SOUTH statement - but this positions the panel across the very bottom which causes the bottom JPanel and part of the text area to disappear.
    Can anyone help with this please???
    Many thanks
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Panels extends JFrame implements ActionListener
         private TopPanel topPanel;
         private BottomPanel bottomPanel;
         private JButton open;
         private JButton close;
         private JButton connect;
         boolean openClicked = false;
         boolean closeClicked = false;
         public Panels()
              super("Panels");
              setSize(1000,600);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              setVisible(true);
              Container contentArea = getContentPane();
              topPanel = new TopPanel();
              bottomPanel = new BottomPanel();
              JTextArea textArea = new JTextArea("Text Area",20,20);
              JScrollPane textScroller = new JScrollPane(textArea);
              open = new JButton("Open");
              open.addActionListener(this);
              close = new JButton("Close");
              close.addActionListener(this);
              connect = new JButton("Connect");
              connect.addActionListener(this);
              JPanel topBar = new JPanel();
              topBar.setBackground(Color.red);
              topBar.add(open);
              topBar.add(close);
              JPanel lowerBar = new JPanel();
              lowerBar.setBackground(Color.red);
              lowerBar.add(connect);
              bottomPanel.setPreferredSize(new Dimension(100,100));
              contentArea.add(topPanel);
         contentArea.add(bottomPanel,BorderLayout.WEST);
              contentArea.add(textScroller,BorderLayout.EAST);
              contentArea.add(lowerBar,BorderLayout.SOUTH);
              contentArea.add(topBar,BorderLayout.NORTH);
              setContentPane(contentArea);
    public void actionPerformed(ActionEvent e)
         if(e.getSource() == open)
         openClicked = true;
         topPanel.repaint();
         if(e.getSource() == close)
         {closeClicked = true;
         bottomPanel.repaint();
    class TopPanel extends JPanel
         public TopPanel()
         public void paintComponent(Graphics painter)
              super.paintComponent(painter);
              painter.setColor(Color.white);
              painter.fillRect(0,0,getSize().width,getSize().height);
              if (openClicked == true)
              drawTopMessage(painter);
         public void drawTopMessage(Graphics painter)
              painter.setColor(Color.black);
              painter.drawString("This is the top panel", 20,20);
    class BottomPanel extends JPanel
         public BottomPanel()
         public void paintComponent(Graphics painter)
              super.paintComponent(painter);
              painter.setColor(Color.yellow);
              painter.fillRect(0,0,getSize().width,getSize().height);
              if (closeClicked == true)
              drawBottomMessage(painter);
         public void drawBottomMessage(Graphics painter)
              painter.setColor(Color.black);
              painter.drawString("This is the bottom panel", 20,20);
    public static void main(String[] args)
         Panels example = new Panels();

    One solution would be to create a new panel, bothPanels and adding the two panels that you need to this panel.
    Once you have done that, you can add bothPanels to contentArea.add( bothPanels, BorderLayout.CENTER)
    hth

Maybe you are looking for

  • How to download multiple sheets in one excel workbook

    Hi All,         I have requirement to download multiple sheets in excel workbook. I had successfully downloaded multiple sheets in excel. But it was downloaded only in my desktop. My requirement is user selects the path and i have to download the dat

  • PDF files don't display on mobile devices after a GWIA upgra

    Hi everybody, After the upgraded to version 2014, the GWIA was very problematic that the Novell Engineer decided to delete the GWIA object and recreate it. The problem was that I forgot and he forgot to take screen shoots of the GWIA configuration pa

  • Advice Needed... which is better?

    Hello...  I am not a computer 'genius", but not a complete "computer idiot' either.  I have a question, and then I will give my reasoning, because maybe it matters in the decision. Which is better, a PC (Gateway) with 6GB Ram, i5 processor, 1.5TB HD 

  • Maintain RAW filename when renaming in Lightroom

    When renaming files in Lightroom 1.2 when you are exporting files how do you keep the original RAW filename in Metadata? I cut DVDs of my files after they are downloaded and want to be able to tell what the original filename was before it was renamed

  • According to You, It's better use ios 7.1 or 7.0.4?

    According to You, It's better use ios 7.1 or 7.0.4? Please Help Me and Please Answer. ( For iPhone 4S )