Add captions to all images in a document

Does anyone already have a script that will add captions to all the images in a document? Right now I have to select each image on each spread which doesn't feel very efficient.

Hi Sandee!
Would that be using CS5's automatic caption function, or just "captions in general"?
If the latter, I s'pose it's not too hard to write a quick & dirty script to add a text frame below (above?) each image, sets its width to the image size, sets the height to a reasonable amount, optionally add an object style to it, and (for instance) copy the image file name into it so you know what you're talking about.
If the former ... anyone else?

Similar Messages

  • Selecting All Images in a Document over multiple pages

    Hello,
    Is there anyway to select all the images in a document, not just a spread.
    For example, if I want to apply an object style to every image.
    I can only do one page (spread) at a time
    There was a post out there that started like this, but started talking about converting to outlines, so this part was never answered.
    I was teying to find something through GREP, but nothere there either.
    Is this possible?
    thanks
    babs

    Oh bait. I like bait.
    for (a=0; a<app.activeDocument.allGraphics.length; a++)
         if (app.activeDocument.allGraphics[a].imageTypeName in {"JPEG":0, "PNG":0, "TIFF":0, "Windows Bitmap":0, "CompuServe GIF":0, "Photoshop":0})
    app.activeDocument.allGraphics[a].parent.appliedObjectStyle = app.activeDocument.objectStyles.item("test");
    //     else
    //          alert (app.activeDocument.allGraphics[a].imageTypeName);
    .. and perhaps some more raster formats -- I don't know exactly which types ID distinguishes by name. You can find the type name per image in the Info palette -- it doesn't seem to differentiate between TIF and TIFF, for example. "Photoshop" is any PSD file.
    An Illustrator file is tagged "Adobe PDF" (not weird, if you know how it works), and a placed InDesign page as "InDesign". Didn't find a real EPS quick enough to test that as well, but you could try.
    If you remove the comment slashes from the 'else' part the script will show an alert for the image types it did not change.
    All of these types are distinguished by type name only, you cannot check for a PDF only containing a single raster image, or a PSD containing vector info.

  • Adding name of indesign document to metadata of all images used in document

    I have been asked to include the indesign file name in the metatag of each image used in every document i produce from here on.
    is there a way to write a script in indesign that will copy the document name then open every link (in bridge?) and append the document name to the metadata (i don't want to lose any existing tags) and then save?
    scott

    This should should give you a start. It'll add the active documents name to the field instructions of the img when executed. Tested once. No errorhandling.
    currDoc = app.activeDocument;
    docName = currDoc.name;
    docGraphics = currDoc.allGraphics;
    for(var g = 0; g < docGraphics.length; g++){
        currGraphic = docGraphics[g];
            currGraphicFilePath = currGraphic.itemLink.filePath;
            fileObject = File(currGraphicFilePath);
    writeDocNameToMeta(fileObject, docName);
    function writeDocNameToMeta(fileObject, docName){
    if(loadXMPLibrary()){
            var myFile = fileObject;
            xmpFile = new XMPFile(myFile.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_UPDATE);
            var myXmp = xmpFile.getXMP();
                  var myStatus = myXmp.getProperty(XMPConst.NS_PHOTOSHOP,"Instructions");
       myXmp.deleteProperty(XMPConst.NS_PHOTOSHOP, "Instructions");
       myXmp.setProperty(XMPConst.NS_PHOTOSHOP, "Instructions", docName);
       if (xmpFile.canPutXMP(myXmp)) {          xmpFile.putXMP(myXmp);    }
            xmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);
            unloadXMPLibrary();
        function loadXMPLibrary(){
            if ( !ExternalObject.AdobeXMPScript ){
                try{ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');}
                catch (e){alert('Unable to load the AdobeXMPScript library!'); return false;}
            return true;
    function unloadXMPLibrary(){
            if( ExternalObject.AdobeXMPScript ){
                try{ExternalObject.AdobeXMPScript.unload(); ExternalObject.AdobeXMPScript = undefined;}
                catch (e){alert('Unable to unload the AdobeXMPScript library!');}
    Hans-Gerd Claßen

  • Anchor all images within a document

    Hello everynbody,
    i am currently triing to write a script that loops all (not anchored) graphics within a document. I want to anchor the image because i want them to move along with the text.
    Here are the steps i took so far:
    1. Iterating through graphics using "myDocument.allGraphics"
    2. Check if "myGraphic.parent.parent.constructor.name" is Character or Page. If it is character the image is already anchored.
    3. Iterate through all text frames on the page of the current image and
    determine one frame that overlaps the Rectangle of the image.
    4. Determine the everage height of a line of the frame (Heigh of frame / number of lines)
    5. Determine the line number of the insertion point for the graphic (=iLine)
    6. Determine the average number of characters per line (=averageChars)
    7. Calculate the average width of a chracter (width if text frame / average number of chars per line)
    8. Calculate the number of characters for the indention (horicontal) of the graphic (=iChars)
    9. Insert graphic as follows:
    var myNewGraphic = matchingFrame.insertionPoints.item(iChars + iLines * averageChars).place(file, false);
    10. Delete the original graphic and it´s rectangle
    My problems are as follows:
    1. The insertion position of the image is never correct even though the calculated line number (iLines) and the calculated indention (iChars) is correct.
    2. After insertion of the image the text does not flow correctly around the contures of the image
    3. I dont know how to set the options for anchored objects as listed in (Objekt -> Verankertes Objekt -> Optionen IN GERMAN VERSION OF INDESIGN)
    I am using Windows XP SP3, i am working with Adobe InDesign CS3 and for scripting i am using JavaScript (for compatibility between MAC and WINDOWS).
    Thanks everybody. If the source code is needed i will provide it.

    Thomas,
    >1. The insertion position of the image is never correct
    You need to start at the end of the document and work your way to the beginning. This is to ensure that references to graphics and frames remain constant.
    >2./3. I dont know how to set the options for anchored objects as listed in (Objekt -> Verankertes Objekt -> Optionen IN GERMAN VERSION OF INDESIGN)
    All these are enumerations, so you should use the English names. The object-model viewer shows the terms you can use (see under anchorPosition, anchorObjectDefault, anchorObjectSettings, etc.).
    Peter

  • Add Captions to each Image in a Web Gallery.

    Adding captions to each individual image in a gallery is one of the most common things people do with web  galleries, not to have this capability is very odd.  What gives?

    thanks i realize that there are free & great products out there that will work i'm just irritated that i pay 2 grand for an adobe cs bundle and they don't supply us with something as standard as a simple way to put captions in a flash web gallery.

  • Resizing/compresing images within a document

    Hi
    I am trying to compress all images within a document I've just creacted, in order to avoid having a 20Mb size document, but I cannot find the tool anywhere. I am just new to Pages, transfered from Office Word, where this task can easily be done by write clicking and imag properties.
    Would someone be able to help me?
    Thanks

    Thanks dennis.
    Thats what I've been doing, exporting the images into mail and re-sizing them, then a drag and drop into the document. Seems rediculous though. We make reports so we have loads of documents, all around 50MB, it soon builds up.
    I'll leave feedback in pages I recon.
    Regards,
    Rob

  • How to add title/caption to each image in Bridge web gallery

    Hi,
    I am creating a web gallery within Bridge and I want to add a title and caption to each image in my web gallery. How do I do that? The only thing I see is the Site Info. section and that adds a title and caption to the entire web gallery (including each image) and I want different titles and captions for each image. There must be a simple way to do this I just haven't figured it out yet. Any help would be greatly appreciated. Thank you!
    ashmic19

    Thanks Curt Y for your help. The thing is I have to use only Bridge. I looked up this problem on http://www.experts-exchange.com/ and they said it was not possible to add titles and captions for individual images (slides) in a web gallery in Bridge. They seemed to imply that this was overlooked. So I input what I could based on what was provided by Bridge and turned it in. Thanks to all who viewed and replied to this post. I appreciate it.
    ashmic19

  • Add caption to MS Word image using activex

    I used LabVIEW to add an image at a bookmark in a Word document. Now I'm trying to add a caption to that image, but having no luck. I keep getting errors on my InsertCaption method--either "Error -2146824090 occurred at Exception occured in Microsoft Word: Command failed" or Type mismatch, depending on the parameters I use.
    I've browsed this forum and others, but can only find solutions for those that have the report generation toolkit, which I do not.
    Code is attached. Any ideas?
    Justin
    Solved!
    Go to Solution.
    Attachments:
    Word write image.vi ‏22 KB

    Beautiful! Works great, thank you!
    I've attached the working code in case anyone else ever needs something similar...
    Attachments:
    Word write image.vi ‏25 KB

  • Is it possible to find all images below 300dpi in a document?

    Hi there, I'm hoping this is a quick question. I've had a look on google but to no avail.
    Is it possible to find all images within an indesign document that are below 300dpi. I've got a lot of images placed in a document, quite a lot were low res (not all, but a lot) just for quickness to begin with...but now I need to replace them with the high res for print, and theres LOADS so i don't really wanna do it manually.
    I know when you do preflight indesign will tell you if there are any images using RGB colour space, but will it do somehting similar with image quality?
    Mac OSX 10.5.8, InDesign CS3

    Okay, here is a fast one but it seems to do the job.
    Copy the text in the frame below into a plain text document using Notepad, Textedit (in plain text mode!), or -- safest -- InDesign's own ESTK Editor that comes installed with the package. Save as "ReportBadResolution.jsx" in your User Scripts folder (see also InDesignSecret's How to install scripts in InDesign).  Double-click to run.
    If nothing happens, all images are okay. If you get an error somewhere, you have used images in a way I did not foresee (and thus didn't script how to handle these); try to report what goes wrong where and on what sort of image, if possible.
    If the script does find anything wrong -- it checks for a minimum resolution of 300 dpi and, as a bonus, on badly scaled images -- it will create a new blank document and fill a text frame with the relevant information: image name, page, and x/y resolutions. It creates only one single page so if you get an 'overset text plus' at the bottom you have lots and lots of bad images ...
    Here's the script to copy:
    //DESCRIPTION:Report Bad Resolutions for a New Year
    // No Guarantees, Ltd. Use at your own risk.
    // Jongware, 05-Feb-2010
    // Minimum dpi allowed:
    var minimumValue = 300;
    // Alert when x/y scaling is off by this much percents:
    var percentageScaling = 1;
    var lowResList = new Array;
    for (aGraphic=0; aGraphic<app.activeDocument.allGraphics.length; aGraphic++)
    oneGraphic = app.activeDocument.allGraphics[aGraphic];
    try {
      xres = oneGraphic.effectivePpi[0];
      yres = oneGraphic.effectivePpi[1];
      if (xres < minimumValue || yres < minimumValue)
       lowResList.push (oneGraphic);
      else
       if (xres < yres)
        scaling = 100*yres/xres;
       else
        scaling = 100*xres/yres;
       if (scaling > 100+percentageScaling)
        lowResList.push (oneGraphic);
    } catch (_) {}
    if (lowResList.length > 0)
    doc = app.documents.add();
    frame = doc.textFrames.add({geometricBounds:[0,0,doc.documentPreferences.pageHeight, doc.documentPreferences.pageWidth]});
    txt = '';
    for (i=0; i<lowResList.length; i++)
      pg = ultimateParent (lowResList[i]);
      txt = txt+"File: "+lowResList[i].itemLink.name;
      if (pg.parent instanceof(MasterSpread))
       txt = txt+' on Master spread '+pg.name;
      else
       if (pg instanceof(Spread))
        txt = txt+' on clipboard of pg '+pg.pages[0].name;
        for (j=1; j<pg.pages.length; j++)
         txt += '-'+pg.pages[j].name;
       } else
        txt = txt+' on pg '+pg.name;
      txt = txt+' has xres: '+lowResList[i].effectivePpi[0]+', yres: '+lowResList[i].effectivePpi[1]+'\n';
    frame.contents = txt;
    } else
    alert ("No images have a resolution less than "+minimumValue+" dpi");
    function ultimateParent(obj)
    while (1)
      obj = obj.parent;
      if (obj.constructor.name == "Page")
       break;
      if (obj.constructor.name == "Character")
       obj = obj.parentTextFrames[0];
      if (obj.constructor.name == "Spread" || obj.constructor.name == "MasterSpread")
       break;
    return obj;

  • I'm working in Pages 4.1. I want to add text to a header but for it to appear only on that page in stead of duplicating itself on all pages of the document. How can this be done?

    I'm working in Pages 4.1. I want to add text to a header but for it to appear only on that page in stead of duplicating itself on all pages of the document. Can this be done?

    See this thread: https://discussions.apple.com/thread/3728197?start=0&tstart=0

  • Where does time machine store content that would be found in the Finder window under "All Images, All Movies, All Documents"? Also, I have many Garageband projects and mp3 files I can't find.

    Where does time machine store content that would be found in the Finder window under "All Images, All Movies, All Documents"? Also, I have many Garageband projects and mp3 files I can't find.

    Easiest way to find time machine files is to open up the folder or application(works for email and iphoto)  they were in - then click on time machine ICON or enter time machine from the time machine menu to go back through the files.

  • Embedding All Placed Images in a Document

    Is there any way to automatically embed all the placed images in a document, or do they need to be handled one by one?

    Links Palette: Click the top linked image.
    ShiftClick the bottom linked image.
    Flyout menu: Embed Image.
    JET

  • Resize all images in document

    Hello,
    I have long document with 300+ images. I need to re size them all to W=63,5 mm and H=53 mm. I dig the Forum and find out this script from user "Harbs." but it is for re scaling images to certain percent:
    This will scale all images to 90% of their current size:
      myGraphics = app.activeDocument.allGraphics;   for (idx = 0; myGraphics.length > idx; idx++) {    if(myGraphics[idx].constructor.name!="Image"){continue}    myGraphics[idx].parent.horizontalScale = 90;    myGraphics[idx].parent.verticalScale = 90;   }
    And this will scale them to an absolute 90%:
      myGraphics = app.activeDocument.allGraphics;   for (idx = 0; myGraphics.length > idx; idx++) {    if(myGraphics[idx].constructor.name!="Image"){continue}    myGraphics[idx].horizontalScale = 90;    myGraphics[idx].verticalScale = 90;    myGraphics[idx].parent.fit(FitOptions.FRAME_TO_CONTENT);   }
    Anyone knows how to make it to resize the images to specific size?
    Thanks!

    Setting width and height is a bit more complicated because you have to calculate the bounds (there isn't a width and height property for an image). I can't do it off the top of my head with javascript, but if you're using OSX this Applescript would resize from the upper left corner.
    tell application "Adobe InDesign CC 2014"
        tell active document
            set properties of view preferences to {horizontal measurement units:millimeters, vertical measurement units:millimeters}
            repeat with x in all graphics
                set {a, b, c, d} to geometric bounds of x
                set geometric bounds of x to {a, b, a + 53, b + 63.5}
                tell parent of x
                    fit given frame to content
                end tell
            end repeat
        end tell
    end tell

  • Word document is all images

    After I convert pdf to word, the word document is all images and I cannot edit the text?

    Hi
    Can you try to OCR the document?
    This option "Recognize Scanned text in"is available in Export options dialog during conversion.
    Thanks
    -sarabjit

  • What is the Search for:-  All images/All documents/all movies for in Finder

    I am confused as to the purpose of Search for:- All images/documents/movies in Finder. I seem to have documents, pictures and music I have never seen or downloaded, and often photos I have actually downloaded are copied in triplicate sometimes more. I have at times got 10,000 items in my documents in Search for? My worry really is does this all take up memory on my computer and if so why is it happening and how do I stop it?
    I do hope someone can explain the purpose of the Search For?
    Jai309

    Thanks Kappy, I had thought that is what it probably was but just confused by all the items I never searched for or downloaded. Now that I know it doesn't take up any memory I shan't worry about it. When I deleted everything from the search for files all the photos in my iphoto and documents were also removed. (thankfully I always have my stuff backed up on hard drive) I guess one just shouldn't remove them? Is there a safe way to clear it out without loosing the stuff I need to keep?
    Regards
    Jai309

Maybe you are looking for