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

Similar Messages

  • How can I get my Indesign script to apply to all pages in the document?

    My script (java) shown below will only apply to the first page of the document. How can i get it to apply to all pages of my document? What am I missing? Thanks.
    scirpt:
    myDocument = app.activeDocument
    with (myDocument.pages.item(0).marginPreferences){
    columnCount = 1;
    //columnGutter can be a number or a measurement string.
    columnGutter = "0";
    bottom = "0"
    //When document.documentPreferences.facingPages == true,
    //"left" means inside; "right" means outside.
    left = "0"
    right = "0"
    top = "0"
    inside = "0"

    Hi,
    You have to iterate through all pages.marginPreferences:
    var
      myDocument = app.activeDocument,
      allPagesMaPref = myDocument.pages.everyItem().marginPreferences,
      curPageMaPref;
    while ( curPageMaPref = allPagesMaPref.pop() )
      with (curPageMaPref) {
      columnCount = 1;
      //columnGutter can be a number or a measurement string.
      columnGutter = "0";
      bottom = "0"
      //When document.documentPreferences.facingPages == true,
      //"left" means inside; "right" means outside.
      left = "40"
      right = "0"
      top = "0"
      inside = "0"
    Jarek

  • 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

  • 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.

  • 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?

  • Why do the file extensions (.jpg .gif .png) no longer appear when I click on a previously saved image to use that image's file name (particularly important when saving a series of images using the same root name)?

    I save a lot of images using firefox, often times from a large batch or series of images. It used to be that I would click on a previously saved image and the entire file name including the file extension (i.e. image_example.jpg) would appear in the "save as" line. Now when I click on a previously saved file, the file name appears without the file extension (i.e. image_example). Which means I have to manually type .jpg every time. For a large collection of images that I am hoping to use the same root file name and then add chronological numbers at the end, this has become incredibly frustrating, especially as it is a previously unnecessary task.
    I am using a new Macbook Pro and maybe there's something Apple related to this...? It did not happen on my old PowerBook G4. I have file extensions turned on in System Preferences.
    It should be noted that I have searched high and low and have even gone into the Apple Genius Bar where they were just confused as I was and of course ended by urging me to use Safari (shocker!) as it has all kinds of new extensions and bells and whistles. I seriously feel alone on an island with this dumb, hard to google problem. Thanks so much for any help anyone out there might have.
    I mean: is this as simple as changing a setting in about:config?
    Your assistance is greatly appreciated.

    Thanks for your response Mylenium, however like I mentioned multiple times, I did change all of my trackpad/scrolling settings in system preferences.  And if I wanted to use a normal mouse (or a tablet), I would've gotten an iMac instead of a MacBook Pro.  I travel often and work all over the place, not always with access to a decently sized workspace that would be required for using a mouse or tablet.

  • Indesign Exported into PDF - not all images are showing.. !!!!

    I've created a DL Phamplet in Indesign, using images from Photoshop (All converted to CMYK,PSD and flattened and used Illustrator files for other objects with the extension (filename).ai afterwards.)
    I don't understand why my particular acrobat doesn't show the complete logo. This doesn't occur on two of my the computers at work PC and Mac, but it occurs at my manager's computer and once on my computer. I've outline all the fonts and images etc to ensure everything is in order. Everything is ungrouped as well to ensure all is outline.
    View problem here
    http://img291.imageshack.us/my.php?image=picture1yp2.jpg
    I've even exported the pdf from the computer that had no problem viewing the missing part of the logo - however when previewing it on my computer, the logo seems to be missing still.
    I think its a previewing problem of some sort but not sure. Do I need a certain plugin - I've updated my software and I haven't reinstalled the software. Please assist. Many thanks.
    Other information that may assist?
    Working on Mac OS X Version 10.4.11
    CS3
    Acrobal Professional 8

    The white logo is undoubtedly set to overprint. Go back into Illustrator
    and fix it.
    Bob

  • How to add metadata to multiple images via Template

    Hi
    Wonder if anyone can tell me if it is possible to add Metadata to multiple images using a metadata template.  I see that I can add to multiple using Organizer but with that you have to type in the metadata.  In Elements 11 I can do it using a template but only for 1 image at a time.
    Is there a way to do this in Elements 11 or Organizer?
    Thanks in Advance.

    In the File properties dialog of the editor you can enter your values in the metadata tabs, then use the 'Import' button on the bottom of the dialog, switch to 'Export' and that exports your values as a template.
    As far as I know, this is to be used in the advanced dialog of the downloader : you can use your templates at import time for a batch of images.
    Otherwise, when you have selected many images in the organizer, you can click on the 'Add IPTC data' button in the tags panel on the right side : you have to enter the data which will be applied to all the selected files.

  • 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

  • Assign task with use a document variable

    Hi,
      if i'm assigning a pdf document in assign task operation with use a document variable instead of application asset, I see the same old blank form after user submits the form.
    what ever typed in the form is not seen in the output variable assigned in Assign user task.
    If I use application asset and provide input xml, then I could see the filled form as output when user submits.
    What should I do to get the filled data in the form?
    Note: Reason for using document variable is I want to dynamically assign the form created in the process to assign task instead of getting from repository.
    Highly appreciate your assistance.
    Thanks,
    kc

    Ok. So are you populating document with the values entered by user in process before assigning.
    Best approach is to xml and application asset.
    And do you have your pdf document binded with xml schema. If not then you wont have fields populated in any way.
    Thanks,
    Prashast

  • How to get sharepoint document library metadata details from sql?

    I am creating a windows form application , in which user selects document library and after clicking on button I am creating an excel file which displays all document name with its metadata information.
    The select query which I am querying to SQL Server is:
    DECLARE @listId AS UNIQUEIDENTIFIER = 'c8508816-a7fb-43f1-82d1-62d79cbaf8e6';
    DECLARE @fileNameFilter AS VARCHAR (250) = NULL;
    DECLARE @dirFilter AS VARCHAR (250) = NULL;
    SELECT DISTINCT
    d.Id AS 'FileId',
    d.WebId AS 'WebId',
    d.SiteId AS 'SiteId',
    d.DirName AS 'DirName',
    d.LeafName AS 'FileName',
    ISNULL(d.Size,0) AS 'Size',
    d.UIVersion AS 'UIVersion',
    ISNULL(d.InternalVersion,0) AS 'InternalVersion',
    ISNULL(d.ETagVersion,0) AS 'ETagVersion',
    d.Type as 'Type',
    aud.tp_Created AS 'Created',
    ui.tp_Login AS 'CreatedBy'
    FROM AllDocs AS d
    INNER JOIN
    AllUserData AS aud
    ON d.Id = aud.tp_DocId
    INNER JOIN
    UserInfo AS ui
    ON aud.tp_Author = ui.tp_ID
    WHERE d.ListId = @listId
    AND (@fileNameFilter IS NULL
    OR d.LeafName LIKE '%' + @fileNameFilter + '%')
    AND (@dirFilter IS NULL
    OR d.DirName LIKE '%' + @dirFilter + '%');
    By using this query I am able to get the file name, its directory name, version but I want to fetch all data like custom fields with this query. I don't know which table to query for custom fields and content type fields.
    Please help.

    Hello,
    MS never suggest to query content database directly. If you do this then you are on risk and can face performance issue.
    if you really wants to get document name and it's metadata then use lists.asmx in windows application. This is standard way to get data from site.
    http://msdn.microsoft.com/en-us/library/dd490727%28v=office.12%29.aspx
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Sharepoint 2013 Document Library MetaData Key Filter

    Hello,
    I created a document library with some fields like Client Name(text), Client Type(choice), Document Type(choice). After that  I would like to use that metadata to help me to search documents. I realized that only choice fields are included in the
    key filetr(Client type and Document Type). Is there any way to add the client Name in the Key Filter section, so I can search documents by client name also.
    I am not sure if this problem can be fixed using metadata key filter or I should create a folder structure in the document library to do what I need.
    If you have any advise about the best way to impolement this problem will be appreciate.
    Thank in advance.
    Jhonny Marcelo

    Yes you can do that. 
    You  need to add custom column to get indexed  and the use it on search results page. Try below:
    http://www.tautic.com/refining-a-moss-search-to-a-column-value
    http://www.sharepointtalk.net/2011/10/using-custom-fields-in-search-results.html
    http://waelmohamed.wordpress.com/2011/05/31/add-custom-search-properties-in-your-advanced-search-sharepoint-2010/

  • InDesign CS6: preflight & non-existent overset text in my document.

    Hi,
    I’m using InDesign CS6. The preflight lists overset errors. When I click on the page icon and go to where the overset txt is supposed to be…there is none.
    I deleted EVERYTHING in the entire document, then did a SAVE-AS a new name; restarted InDesign; opened the empty document...and it still says I have overset text. I’ve had this issue before with other documents and just ignored the errors after hours of trying to fix the non-existent overset text - but other people have to use my documents. Having errors is an issue with shared documents. I started a chat with an adobe tech support person, but they had no idea what the problem is. Is this a bug? More importantly, is there a fix?
    any help much appreciated.
    regards,
    m

    I have a document with a similar issue. I just opened it just to check. When I click on the overset and click somewhere else, I get an empty text frame. I guess that's what happens to you as well. I turned on Show Hidden Characters and noticed that somehow I had at the bottom of the page a paragraph sign (probably I hit enter at the end without noticing it). I just deleted it and now is fine. Turn on the Show Hidden Characters and see if something shows up at the end of your document.

  • Structure inDesign document and export as XML for use in the web

    Hello everyone,
    I just recently started using inDesign and I am fascinated by its possibilities! I use it for a project where a finished inDesign layout that is used for a printed publication is now supposed to be transformed for implementing it on a web site. My job is to export the inDesign document as an XML file. After massive reading the last weeks I'm quite familiar with the structuring and tagging in inDesign. Though there's some issues I do not understand. Your precious advice would be of highest meaning to me
    The programmer who will later use my XML output for the web-transformation needs the document structured in different levels like "Root > Chapter > Subchapter > Text passage / table". I already structured the document with tags like title, text passage, table, infobox,... but the structure is just linear, putting one item following to another.
    How can I structure the document with reoccuring tags that enable me to identify the exact position of an item in the document's structure? So that I can say for example "text passage X" is located in chapter 4, subchapter 1. This has to be done because the document is supposed to be updated later on. So maybe a chapter gets modified and has to be replaced, but this replacement is supposed to be displayed.
    I hope my problem becomes clear! That's my biggest issue for now. So for any help I'd be very thankful!

    Our print publications are created in InDesign CS5 for Mac then the text is exported to RTF files then sent to an outside company to be converted to our XML specifications for use by our website developers.  I would like to create a workflow in which our XML tags are included in the InDesign layouts and then export the XML from the layouts.
    Some more detail about what kind of formatting is necessary might be helpful.
    I know that IDML files contain the entire layout in XML format.  Is it a good idea to extract what we need from IDML, using the already-assigned tags?
    Well, if you want to export the whole document, it's the only reasonable approach.
    We use a workflow system such that each story is a seperate InCopy document, stored in ICML format (Basically a subset of IDML). Our web automation uses XSLT to convert each story into HTML for use on our web site; it also matches it up with external metadata so it knows what is a headline and what is not, etc.. It is not exactly hassle free, and every once in a while someone uses a new InDesign feature that breaks things (e.g., our XSLT has no support for paragraph numbering, so numbered paragraphs show up without their numbers).
    You could do the same thing with with IDML, you'd just have to pick out each story, but that's small potatoes compared to all the XSL work you're going to have to do.
    On the other hand, there may be better approaches if you're not going to export the whole document. For instance,  you could use scripting to export each story as an RTF file, and then you could convert the RTF files into HTML using other tools.

  • Sql Server 2008 Reporting Security issue ( added name to Server, some how cannot acces the report ) getting error message

    have added name to Sql server , users cannot access the report, getting error message ,
    I have give all the permission to this users, so why this users still cannot look at the report,
    and getting error message,
    An error has occurred during report processing.
    cannot create a connection to data source Ax live
    for more information about this error navigate to the report server on the local server machine or enable remote errors.
    can some please help me what this message means,
    I really appreciate it
    thanks In advance

    If "Credentials supplied by the user running the report" is selected, when the report is run, the user will be prompted to provide credentials.  They would need to provide credentials that have the appropriate permissions (e.g., read, execute) to the
    database.  This prevents the double hop.
    If "Credentials stored securely in the report server" is selected, you have to enter the username and password of a user (or service account) that has the appropriate permissions (e.g., read, execute) to the database. When the report is run, SSRS will use
    these stored credentials each time to authenticate to the database engine and query the data.  Users running the report are not prompted to provide credentials.  With this option you can use an Active Directory or SQL Server account.
    In order to access/run the report, a user will need to authenticate to SSRS.  There are options here as well. You can provide them the link to the report manager and they can authenticate, navigate to, and run the report.  You can also provide
    direct links to reports that users click in a document or application.  At this point the user is typically still prompted to authenticate to SSRS.  You can also programmatically call the report using API's and essentially build a proxy that authenticates
    to SSRS and open the report.
    Not sure if that answers your question.

Maybe you are looking for

  • Problems with video.

    I've been having a problem with watching videos such as video podcasts in itunes as of late. I've been getting the audio, but all that shows up for the video is multicolored static. I was able to views these files before in itunes, but it is just rec

  • Itunes 7.0.1 still has major problems with jerky video

    I thought the newest update to Itunes 7 would fix my problems with jerky video that have begun since this Itunes 7 came out. At first I thought maybe my computer was too old (powerbook 12" 1.5 Ghz, with maxed out RAM) to play the new resolution, but

  • Export Dilemma, please help

    I have a dilemma. I use iMovie 08 to import my ACHD. I then edit in iMovie 08 and most often iMovie HD. My source is 1080/60i. I import at Full. My output is in DVD. I want to make a sd dvd and also have a Quicktime File for burning Blu-ray later. Ei

  • Business Activities - not visible on year change

    Hi Gurus, I am facing a weird problem, in SAP CRM 2007 - we created business activities in the year 2009, which were visible in IC - Web Client till Dec 31st 2009. As year changed to 2010, all business activities are now not visible in IC - Web Clien

  • Roles in WLP

    Hi all, I need to put WLP users in different roles. On WebLogic Portal Admin console, I was able to add created users to on PortalSystemDelegator role. I was not able to add users to roles like Admin, Authenticated Visitor, AppTester etc. Can you pro