Place image and centre javascript??

Hello,
I'm trying to create a script (Javascript) which automatically creates a document to a pre specified size (specified within the script), places a file (usually .PDF) centrally on the document page, adds crops, saves and exports.
I've got everything sorted except the place file and centre part - and to be honest after looking through the forums I'm none the wiser. Can you offer some advice please?
The file which is placed will change each time (as will its location), so I was hoping that i could use the standard place command and use the window which comes up normally...although i've horrible feeling I might have to create something - hopefully not!....I realise this is very simple for most of you, but I'm struggling!
Thanks in advance for any help!
(on a side note, would a script made from applescript enable me to select the file to be placed in InDesign, and run everything in one click, opening InDesign etc? just wondering...)

Use the Folder.selectDialog () function to display the OS dialog in which you pick a file. See the JavaScript Tools Guide (in ESTK's Help menu), page 57.
As to your sidenote, you can't have JavaScript start InDesign. AppleScript probably can.
Peter

Similar Messages

  • Manually PLACE images and other files in illustrator

    I see a tutorial of Infographics by Nigel French, In this tutorial when the Mr Nigel use place option to import images or other illustrator files the illustrator not auto put images at center but ask where to place images or how much area to be covered by this image or file.
    I search about this but not found anything relating to this topic, I don't know whether this is plugin or illustrator function/feature.
    I hope you would answer,
    Here are the pictures to ellaborate

    Thanks Monikia for answering
    Yes I mean place gun with 1/1 symbol besides the arrow but how to enable this in CS6 version 16.2.1. I haven't seen any option in preference or in place window.

  • How to place image and crop to fit inside vector shape

    I'm trying to place an image on top of a vector shape and then i want to trim the edges of the image so it takes on that shape (essentially filling the shape with the image)
    I'm also trying to do this with two layers of vector shapes, i want to fit one within the other and not have any over hang.. the top or "filling shape" is an array of hexagons (making a honeycomb like structure) i want it to fit within the underlying oval (lime green one) shape.  here's a link if you want to see what i'm doing.. its the one on the right
    www.oregonstate.edu/~pearsoan/images/achieve3.ai
    How do you do this?

    Blue,
    Put the shaping (vector) path on top of the image, select both, and Object>Clipping Mask>Make.
    I cannot open the file to see what there is to see, and I have to leave in a moment.
    If you upload an image, using the Camera icon, all helpers can see it here in the thread.

  • When i Place a PSD in Indesign it comes in at 200+% while the image frame is considerably smaller. How do i place so that the image and image frame match?

    When i Place a PSD in Indesign it comes in at 200+% while the image frame is considerably smaller. How do i place so that the image and image frame match?

    Peter,
    The screenshots tell you everything.
    The second one tells you how the image frame is automatically set up after a one-click place. It's the blue stroked rectangle with the eight control points at each corner and mid-way along the line. This image frame is generated at a proportionally correct height and width for the image it contains.
    Now, if you look at the third screenshot (click on it to see it at a larger size), you will see I've used the direct selection tool (white arrow) to click on the image within the image frame. This CLEARLY shows the image (within the image frame) is substantially larger than the frame generated to contain it. This is indicated by the yellow stroked rectangle with the eight control points at each corner and mid-way along the line.
    Notice that the blue and yellow rectangles are vastly different sizes.
    In InDesign CS5.5, when i clicked to place the image, the image would fit perfectly within its image frame. the blue and yellow rectangles would match.
    I had no need to go click on the proportional fill and centre buttons like i need to do now in CC.
    I have a keyboard shortcut to place. I can't do File > Place for the amount of images i need to place.
    So to reiterate: How do i place an image so that the image and image frame match?

  • "View in Place" inline images and PDFs in Yosemite Mail

    I'd like to have the "View in Place" option available for images and PDFs, but it appears to be missing in Yosemite Mail. It would be particularly helpful with this new Markup feature. Any ideas how I might do this?

    When I drag a PDF or an image (TIFF, JPEG, etc.) into the body of an Apple Mail message, I see an icon of that file.
    There used to be a contextual menu option to "View as Icon" or "View as Image" in previous iterations of Mail, but now with Yosemite, I am only able to send the message with the image or PDF file viewed as an icon. As a comparison, when Composing a message in the Gmail desktop web interface, you can click on the Insert Image Icon, and you are given the option to insert the image "Inline" or "As attachment." I like having both options and I wonder if there is a Terminal command or third-party solution to restore this functionality.

  • Place video and images in different folder? N73

    Hi All,
    Once I go: gallery/images and video, all images and video will display together. There is no way to create new folder so that I can put, or hide some private images there.
    I've try using PC to do the job, created new folder and place some images in, does't work...
    There is no problem on my previous Nokia phone, can anyone care to share or advise?
    Thanks!

    Unfortunately, some software designer decided that it would be better for users to see all videos and images in one long list no matter where they are, and then require you to use the "Album" feature to organize them.
    In other words, the Gallery simply ignores different folders and shows everything in a long list.
    There's nothing you can do, except use a different app.
    I can only hope that the behaviour returns to something more sensible in future devices.

  • How do I place an image and insert a different photo for the "mouse down" state?

    I have placed an image within an accordian widget and when I select the "mouse down" area in the states dialog box, i click "fill" in the toolbar and insert the photo i want to display when the image is clicked but this image is "covered up" by the originally placed image and is not seen in my states dialog box.
    I have done this before when i made rectangles and placed images in rectangles. But i soon realized that you cannot add alternative text to images in rectangles for some frustrating reason.
    How do I place and image and have a different image for the mouse down state?

    Hello,
    This effect can only be achieved when you use the images as a Rectangle Fill. And as you mentioned it above, you cannot add alternative text to images because it is added as a fill and not as a image.
    I would suggest you to post this as a feature request on our "Ideas for features in Adobe Muse" section of the forums : http://forums.adobe.com/community/muse/ideas
    Regards,
    Sachin

  • How do i insert image and place it where i want to in the pdf

    hi
    i have converted a word to pdf.Now i have my text on the left and i have a image to be inserted on to the right. when i do insert the image just gets inserted in the center or on the top.

    Bill is correct that you have probably the most control by placing your image on a button.  However if you have Acrobat Professional you can use the Touch-up Object Tool to place a graphic.  Simply choose the Touch-up Object Tool i.e. Tools > Advanced Editing > Touch-up Object Tool and then right-click in the area you want to put your image and choose Place Image from the context menu.  If it is not in the exact place you should be able to move it around with the tool as well.
    Best of Luck!

  • How to place two different indesign documents side by side on my desktop in order to copy and paste images and text from one to the other?

    How to place two different indesign documents side by side on my desktop in order to copy and paste images and text from one to the other?

    Or choose Window > Arrange > Tile
    And, you of course can copy/paste without tiling.

  • How do I place a fixed image and show it between two pages like the Global on Page 3 (LOE)?

    How do I place a fixed image and show it between two pages like the Global on Page 3 (LOE)?

    Ohoh, I do think so. It's the trick. Thanks
    BTW, How about including a widget within real time RSS feed?

  • HT202879 Since opening an existing Pages doc, all the previously centred images and tables are now too far to the rights - leaving a large blank space to the left of each page. Any ideas reducing?

    Since opening an existing Pages doc, all the previously centred images and tables are now too far to the rights - leaving a large blank space to the left of each page. Any ideas re fixing this?  Problem remains even when I open an earlier version on the previous version of Pages

    It has always been that the upgrade tries to be the "master" over the older version.
    Anyway in Pages 09 you have probably the Comments field showing, making all contetn to move to the right.
    Go to View menu > Hide Comments.

  • Place images to a specific spot in a template

    I am trying to create an action that will drop images into a specific spot in another document and save it with a certain file name. After the first image is dropped in and saved, I want my next image to do the same and so on. I have all my images cropped to the correct ratio and being pulled from a folder on my desktop. I have my template open in Photoshop where I want my images from that folder to be dropped into. Is this possible?
    Any help is greatly appreciated!!
    Melissa

    Melissa
    What you want to do can be done but it is complex and actions have some limitations and can not use logic without using a script or two. File saving  can be tricky for an action will always save the same file name or use the current document name saved either overwriting the file or saving it to some other particular folder. Action that populate a template can be created but it will always populate the same number of images because an action can not use logic to find out how many spots there are to populate. There are different ways to drop an image into the active document you can paste into an area or just past in the image in as a new layer.  You can also Place images in as smart objects. Each method has some advantages and disadvantages. Layers can also be aligned with selections and layers can be transformed in size.  Your best off creating rule for creating a template and have a plan as to how your going to populate these templates that follow your rules. To protect the template from alteration you may want to dupe the template close the original and work on the duped version. When you dupe the template you can give the dupe a name if you do not name it the new document will have the same name with copy appended.
    Scripting is more powerful then Action but they are programs that are written in a scripting language. Photoshop supports three languages. VBS, Applescript and Javascript. Only Javascript is supported on both the MAC and PC platforms.  Even using Javascript you may need to code the script to work on both platforms for I'm sure there are some differences in the OS and file system the may need special handling to work on both platform.  From you description of you work-flow it is hard to tell exactly what you are doing.   If you trying simple create a photo Collage.  You may want to have a look at my free Package for Photoshop called "Photo Collage Toolkit" . I have been told this package works on a MAC but I created it and tested it on widows and got it To work with CS2, CS3, CS4 and CS5.
    Photo Collage Toolkit UPDATED Sept 24, 2011 added a script to replace a Populated Layered Collage Smart Object Image with an other image with resizing.
    Photoshop scripting is powerful and I believe this package demonstrates this.
    The package includes four simple rules to follow when making Photo Collage Template PSD files so they will be compatible with my Photoshop scripts.
    There are eight scripts in this package they provide the following functions:
    TestCollageTemplate.jsx - Used to test a Photo Collage Template while you are making it with Photoshop.
    CollageTemplateBuilder.jsx - Can build Templates compatible with this toolkit's scripts.
    LayerToAlphaChan.jsx - Used to convert a Prototype Image Layer stack into a template document.
    InteractivePopulateCollage.jsx - Used to interactively populate Any Photo Collage template. Offers most user control inserting pictures and text.
    ReplaceCollageImage.jsx - use to replace a populated collage image Smart Object layer with an other image correctly resized and positioned.
    PopulateCollageTemplate.jsx - Used to Automatically populate a Photo Collage template and leave the populated copy open in Photoshop.
    BatchOneImageCollage.jsx - Used to Automatically Batch Populate Collage templates that only have one image inserted. The Collage or Image may be stamped with text.
    BatchMultiImageCollage.jsx - Used to Automatically Batch Populate Any Photo Collage template with images in a source image folder. Easier to use than the interactive script. Saved collages can be tweaked.
    Note: Rags Gardner www.rags-int-inc.com Photoshop Collage Template Builder script Copyright (c) 2006 builds layered Photo Collage Template psd files. Rags's has given me permission to include a modified version of his script in my package. The modification converts Rags's layered image template document into a flattened template compatible with Photoshop "Photo Collage Toolkit" package. There is also an option that will instead create a layered image stack like Rags's templates are these are also produced if you attempt to create a template with more then 53 images.
    Photoshop only supports up to 53 Alpha channels therefore with its design the Photo Collage Toolkit can only support collages with 1 to 53 images. I do not feel this is a big limitation for if you put 53 3:2 aspect ratio images on a large 16" x 20" paper they would need to be less then 1.9" x 2.86" in size if you wanted a frame around each and less then .95" x 1.43" on a 8" x 10" year book page size.
    While the maximum number of images in a collage is 53 you can actually create larger collages by populating a large number of images into several collages and then populate yet an other collage template with these populated collages. Each will be placed into the collage of collages as a single smart object layer. You may want to save the populates PSD file as Jpeg files first to cut down on the overhead of having large PSD file smart object layers in the collage of collages.
    Documentation and Examples

  • How do i place image next to sprymenubar? CS4

    Hey everyone I am extremely new to this all I have no background in coding or dreamweaver. I was able to place an image (my website logo) and create a functioning spry menu bar. however the menu bar is placed below my image and I want it to run side by side with my logo so that the logo and menu bar act as the main navigational buttons for my website.
    <p><a href="------------.html"><img src="-----------.jpg" width="590" height="90" /></a></p>
    <hr align="left" width="1000" />
    <p>
      <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    </p>
    <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css">
    <ul id="MenuBar1" class="MenuBarHorizontal">
      <li><a class="MenuBarItemSubmenu" href="#">Capabilities</a>
        <ul>
          <li><a href="Staff.html">Staff</a></li>
          <li><a href="Locations.html">Locations</a></li>
          <li><a href="Business Models.html">Business Models</a></li>
        </ul>
      </li>
      <li><a href="#" class="MenuBarItemSubmenu">Solutions</a>
        <ul>
          <li><a href="Industries.html">Industries</a></li>
          <li><a href="Strategies.html">Strategies</a></li>
          <li><a href="Big Data.html">Big Data</a></li>
          <li><a href="Cloud Computing.html">Cloud Computing</a></li>
          <li><a href="Product Development.html">Product Development</a></li>
          <li><a href="Outsourcing.html">Outsourcing</a></li>
        </ul>
      </li>
      <li><a class="MenuBarItemSubmenu" href="#">Innovations</a>
        <ul>
          <li><a href="White Papers.html">White Papers</a>      </li>
          <li><a href="Appearances.html">Appearances</a></li>
          <li><a href="Press Releases.html">Press Releases</a></li>
        </ul>
      </li>
    </ul>
    <script type="text/javascript">
    <!--
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    //-->
    </script>

    You'll need to use CSS floats.
    .floatLt {
         float:left;
         width:auto;
    HTML:
    <div class="floatLt">
    YOUR LOGO IMG HERE
    </div>
    <ul id="MenuBar1" class="MenuBarHorizontal floatLt">
    YOUR MENU GOES HERE
    </ul>
    Coding skills are essential to using DW.  Learn HTML & CSS first.  DW will be much easier.
    HTML, CSS & Web Design Theory Tutorials -
    http://w3schools.com/
    http://www.csstutorial.net/
    http://phrogz.net/css/HowToDevelopWithCSS.html
    http://webdesign.tutsplus.com/sessions/web-design-theory/
    Nancy O.

  • Automatically layout large # of images, and rollovers?

    Hello:
    I have about 400 images that I'd like to put in a simple grid layout, and I'm wondering if there's any way to do it that doesn't involve typing in all 400 filenames into the HTML. All the files are located in a single directory and are uniformly named (filename1, filename2...). Is there a way to batch place a large number of images? I'm happy to place them in a table, or using CSS, or whatever works.
    On a related note, I'd also like to learn how to set up the grid so that when the user rolls over an image, that image is displayed larger and, notably, doesn't screw up the layout of the rest of the images -- for example, display the image centered in a new layer superimposed over the grid. I've already got preview and full-size images of all 400 files. I'm sure there's already a thread about this somewhere, but I've searched the forums and I suspect I don't know enough about Dreamweaver yet to know what to look for in the responses.
    Any help would be greatly appreciated. I'm obviously new to all this, but am having a great deal of fun learning. Thank you!
    -Stephen

    Be aware that Java is not the same as JavaScript.  Which are you referring to?  If the former, then I don't think it's much of a practical solution.
    The approach I suggested would work either as a static one (i.e., showing you the code locally which you copy and paste into a real page) or a dynamic one (i.e., the PHP actually builds the matrix of images on the live page), as does Nancy's solution.  In either event, you would need to know enough PHP to be able to build the filename array, and loop through the filenames while you build the matrix of images (and their links to a lightbox-type display).  If you are indeed fluent in Java then PHP should be something you can cobble together - it's very C-like.
    The good news is that if you take Nancy's suggested approach, then any new images would automatically be added to the matrix since each time you create the matrix, you do so from the filenames that are found in that image directory.

  • Who came up with the ridiculous idea of removing disable images and javasceipt checkboxes in options? Please bring it back or it's bye bye firefox for me.

    My browser recently updated to firefox 23 and I was so shocked to see the core functions - disable images and javascript missing. I spent a good while going through every single menu and sub-menu because the idea that firefox could make such a laughable and stupid decision to remove it didn't even occur to me. I've been using firefox for YEARS, and in all the 20+ releases I've lived through, this by far wins the cake of WTF. I use these features on daily basis and I seriously have no idea what made firefox developers think that they won't make users flip the tables by removing such useful basic functionality. So if this isn't fixed in next update, I'm giving up firefox. It sucks to have to part with it after so long, but you're giving users no choice. A browser that is so severely handicapped isn't worth wasting my time on. I'll go back to firefox 22 until I see if this is addressed in near future, else I need to go for google chrome.
    Honestly, VERY very disappointing update from firefox.

    Agreed with the first poster. I just had to spend more time than I thought necessary trying to deal with this just to simply do something that was always so simple before in FireFox.
    Thanks to that complicated QuickJava plugin suggested as an alternative, I clicked its button to see what would happen... and WHOOPS! There goes Javascript. Clicking it back doesn't re-enable it. Thanks. This is just what I needed when I wanted to ONLY DISABLE IMAGES.
    Instead of playing around with its settings I decided to just remove it asap and try another avenue instead of screwing up my settings any more being new to the add-on. Removing the plugin left my browser without Javascript... great. That was a fun experiment. I guess that's my "thank you for trying!".
    Congratulations, OP, for making it clear how ridiculous this dumb decision was. I'm going to follow your suggestion and actually say "bye bye" to Firefox. I've been using it since the days when it used to be called Firebird. Yeah, long time ago. And this day marks the end. It seems the policy these days is to appeal to newcomers to computers, instead of the actual computer users who made this program popular in the first place. This seems to be the death kiss for any good piece of software that gets too popular.
    </rant>

Maybe you are looking for

  • Premiere Pro has encountered an error - nothing seems to fix it!

    Hey all, I'm running Premiere Pro v. 6.0.2 on Mountain Lion 10.8.2, with a standard ATI Radeon 5770 in a 3.33 GHz 6-Core Mac Pro 5,1. Whenever I try to open the program OR a file, I get the following message: "Premiere Pro has encountered an error. [

  • Bugs + 1.0.4?

    One definite bug and one I'm not so sure. Definite bug... all songs are (Last Played) tagged with the date/time it is synced, not when the song was actually played. I use iVolume, meaning the level is set by iVolume. Works 100% correctly on my 80G HD

  • Popping sounds in FCP when importing from itunes

    I'm trying to use a piece of music dwonloaded from itunes. listening ot the piece on itunes there are no "pops" or crackle sounds. Once imported to FCP and incerted inot my track it has annoying pops, suttle but they are there. How can I fix this?

  • Help with audio/photo/subtitle

    Hello. What I've been trying to do is take a song, coordinate subtitles karaoke style, and add a slide show of photos and maybe a few video clips. Maybe unfortunately, I already added and synchronized the subtitles with the audio. Now I want to inser

  • 2 letters from AT&T with different activation instructions

    After I purchased from AT&T Premier site on June 15, I received an email confirming order received with instructions to activate after I get the phone. Those instructions were to activate on-line with an order and activation numbers on www.wireless.a