LabelGraphics Script

Hi Everyone, I don't know much about scripting so I'm hoping someone can help me. I'm trying to modify the LabelGraphics script to capture the "Date Created" field. I have tons of images that I need to organize based on their date of creation but I need to see the date with the image in the layout (long story). Anyway, I have tried to change XMP Author to Date Created but nothing. Below is the script as it came from Adobe. Any help will be greatly appreciated.
//LabelGraphics.jsx
//An InDesign CS3 JavaScript
@@@BUILDINFO@@@ "LabelGraphics.jsx" 1.0.0 14-September-2006
//Adds labels to the graphics in the active document.
main();
function main(){
if(app.documents.length != 0){
if(app.documents.item(0).allGraphics.length != 0){
myDisplayDialog();
else{
alert("Document contains no graphics.");
else{
alert("Please open a document and try again.");
function myDisplayDialog(){
var myLabelWidth = 100;
var myStyleNames = myGetParagraphStyleNames();
var myDialog = app.dialogs.add({name:"LabelGraphics"});
with(myDialog.dialogColumns.add()){
//Label type
with(dialogRows.add()){
with(dialogColumns.add()){
staticTexts.add({staticLabel:"Label Type", minWidth:myLabelWidth});
with(dialogColumns.add()){
var myLabelTypeDropdown = dropdowns.add({stringList:["File name", "File path", "XMP description", "XMP author"], selectedIndex:0});
//Text frame height
with(dialogRows.add()){
with(dialogColumns.add()){
staticTexts.add({staticLabel:"Label Height", minWidth:myLabelWidth});
with(dialogColumns.add()){
var myLabelHeightField = measurementEditboxes.add({editValue:24});
//Text frame offset
with(dialogRows.add()){
with(dialogColumns.add()){
staticTexts.add({staticLabel:"Label Offset", minWidth:myLabelWidth});
with(dialogColumns.add()){
var myLabelOffsetField = measurementEditboxes.add({editValue:0});
//Style to apply
with(dialogRows.add()){
with(dialogColumns.add()){
staticTexts.add({staticLabel:"Label Style", minWidth:myLabelWidth});
with(dialogColumns.add()){
var myLabelStyleDropdown = dropdowns.add({stringList:myStyleNames, selectedIndex:0});
var myResult = myDialog.show();
if(myResult == true){
var myLabelType = myLabelTypeDropdown.selectedIndex;
var myLabelHeight = myLabelHeightField.editValue;
var myLabelOffset = myLabelOffsetField.editValue;
var myLabelStyle = myStyleNames[myLabelStyleDropdown.selectedIndex];
myDialog.destroy();
var myOldXUnits = app.documents.item(0).viewPreferences.horizontalMeasurementUnits;
var myOldYUnits = app.documents.item(0).viewPreferences.verticalMeasurementUnits;
app.documents.item(0).viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;
app.documents.item(0).viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;
myAddLabels(myLabelType, myLabelHeight, myLabelOffset, myLabelStyle);
app.documents.item(0).viewPreferences.horizontalMeasurementUnits = myOldXUnits;
app.documents.item(0).viewPreferences.verticalMeasurementUnits = myOldYUnits;
else{
myDialog.destroy();
function myAddLabels(myLabelType, myLabelHeight, myLabelOffset, myLabelStyleName){
var myDocument = app.documents.item(0);
var myGraphics = myDocument.allGraphics;
myLabelStyle = myDocument.paragraphStyles.item(myLabelStyleName);
for(var myCounter = 0; myCounter < myGraphics.length; myCounter++){
myAddLabel(myDocument, myGraphics[myCounter], myLabelType, myLabelHeight, myLabelOffset, myLabelStyle);
function myAddLabel(myDocument, myGraphic, myLabelType, myLabelHeight, myLabelOffset, myLabelStyle){
var myLabel;
var myLink = myGraphic.itemLink;
//Create the label layer if it does not already exist.
var myLabelLayer = myDocument.layers.item("labels");
try{
myLabelLayer.name;
catch (myError){
myL

Hi Everyone, I don't know much about scripting so I'm hoping someone can help me. I'm trying to modify the LabelGraphics script to capture the "Date Created" field. I have tons of images that I need to organize based on their date of creation but I need to see the date with the image in the layout (long story). Anyway, I have tried to change XMP Author to Date Created but nothing. Below is the script as it came from Adobe. Any help will be greatly appreciated.
//LabelGraphics.jsx
//An InDesign CS3 JavaScript
@@@BUILDINFO@@@ "LabelGraphics.jsx" 1.0.0 14-September-2006
//Adds labels to the graphics in the active document.
main();
function main(){
if(app.documents.length != 0){
if(app.documents.item(0).allGraphics.length != 0){
myDisplayDialog();
else{
alert("Document contains no graphics.");
else{
alert("Please open a document and try again.");
function myDisplayDialog(){
var myLabelWidth = 100;
var myStyleNames = myGetParagraphStyleNames();
var myDialog = app.dialogs.add({name:"LabelGraphics"});
with(myDialog.dialogColumns.add()){
//Label type
with(dialogRows.add()){
with(dialogColumns.add()){
staticTexts.add({staticLabel:"Label Type", minWidth:myLabelWidth});
with(dialogColumns.add()){
var myLabelTypeDropdown = dropdowns.add({stringList:["File name", "File path", "XMP description", "XMP author"], selectedIndex:0});
//Text frame height
with(dialogRows.add()){
with(dialogColumns.add()){
staticTexts.add({staticLabel:"Label Height", minWidth:myLabelWidth});
with(dialogColumns.add()){
var myLabelHeightField = measurementEditboxes.add({editValue:24});
//Text frame offset
with(dialogRows.add()){
with(dialogColumns.add()){
staticTexts.add({staticLabel:"Label Offset", minWidth:myLabelWidth});
with(dialogColumns.add()){
var myLabelOffsetField = measurementEditboxes.add({editValue:0});
//Style to apply
with(dialogRows.add()){
with(dialogColumns.add()){
staticTexts.add({staticLabel:"Label Style", minWidth:myLabelWidth});
with(dialogColumns.add()){
var myLabelStyleDropdown = dropdowns.add({stringList:myStyleNames, selectedIndex:0});
var myResult = myDialog.show();
if(myResult == true){
var myLabelType = myLabelTypeDropdown.selectedIndex;
var myLabelHeight = myLabelHeightField.editValue;
var myLabelOffset = myLabelOffsetField.editValue;
var myLabelStyle = myStyleNames[myLabelStyleDropdown.selectedIndex];
myDialog.destroy();
var myOldXUnits = app.documents.item(0).viewPreferences.horizontalMeasurementUnits;
var myOldYUnits = app.documents.item(0).viewPreferences.verticalMeasurementUnits;
app.documents.item(0).viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;
app.documents.item(0).viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;
myAddLabels(myLabelType, myLabelHeight, myLabelOffset, myLabelStyle);
app.documents.item(0).viewPreferences.horizontalMeasurementUnits = myOldXUnits;
app.documents.item(0).viewPreferences.verticalMeasurementUnits = myOldYUnits;
else{
myDialog.destroy();
function myAddLabels(myLabelType, myLabelHeight, myLabelOffset, myLabelStyleName){
var myDocument = app.documents.item(0);
var myGraphics = myDocument.allGraphics;
myLabelStyle = myDocument.paragraphStyles.item(myLabelStyleName);
for(var myCounter = 0; myCounter < myGraphics.length; myCounter++){
myAddLabel(myDocument, myGraphics[myCounter], myLabelType, myLabelHeight, myLabelOffset, myLabelStyle);
function myAddLabel(myDocument, myGraphic, myLabelType, myLabelHeight, myLabelOffset, myLabelStyle){
var myLabel;
var myLink = myGraphic.itemLink;
//Create the label layer if it does not already exist.
var myLabelLayer = myDocument.layers.item("labels");
try{
myLabelLayer.name;
catch (myError){
myL

Similar Messages

  • How to change label color in LabelGraphics script?

    I am using ID CS4 and running the LabelGraphics script to label several images in a large document. When I run thre script, the box with the file name is transparent with black type. I would like the box to be white with black type. Is there any way to edit the script that will enable this? It would be great if there was an "object style" in addition to the "paragraph style" in the run script pop-up window. Anyone?

    Hi hylet,
    Here's how to change the LabelGraphics.jsx script itself to add an object style option:
    1. Look for the line:
    var myStyleNames = myGetParagraphStyleNames();
    And add this line before or after it:
    var myObjectStyleNames = app.documents.item(0).objectStyles.everyItem().name;
    2. Look for the lines:
    //Style to apply
    with(dialogRows.add()){
         with(dialogColumns.add()){
              staticTexts.add({staticLabel:"Label Style", minWidth:myLabelWidth});
         with(dialogColumns.add()){
              var myLabelStyleDropdown = dropdowns.add({stringList:myStyleNames, selectedIndex:0});
    And add the following lines after them:
    //Object style to apply to the text frame
    with(dialogRows.add()){
         with(dialogColumns.add()){
              staticTexts.add({staticLabel:"Label Object Style", minWidth:myLabelWidth});
         with(dialogColumns.add()){
              var myObjectStyleDropdown = dropdowns.add({stringList:myObjectStyleNames, selectedIndex:0});
    3. Look for the line:
    var myLabelStyle = myStyleNames[myLabelStyleDropdown.selectedIndex];
    And add this line before or after it:
    var myObjectStyleName = myObjectStyleNames[myObjectStyleDropdown.selectedIndex];
    4. Look for the line:
    myAddLabels(myLabelType, myLabelHeight, myLabelOffset, myLabelStyle);
    And change it to:
    myAddLabels(myLabelType, myLabelHeight, myLabelOffset, myLabelStyle, myObjectStyleName);
    5. Look for the line:
    function myAddLabels(myLabelType, myLabelHeight, myLabelOffset, myLabelStyleName){
    And change it to:
    function myAddLabels(myLabelType, myLabelHeight, myLabelOffset, myLabelStyleName, myObjectStyleName){
    6. Look for the line:
    myAddLabel(myDocument, myGraphics[myCounter], myLabelType, myLabelHeight, myLabelOffset, myLabelStyle);
    And change it to:
    myAddLabel(myDocument, myGraphics[myCounter], myLabelType, myLabelHeight, myLabelOffset, myLabelStyle, myObjectStyleName);
    7. Look for the line:
    function myAddLabel(myDocument, myGraphic, myLabelType, myLabelHeight, myLabelOffset, myLabelStyle){
    And change it to:
    function myAddLabel(myDocument, myGraphic, myLabelType, myLabelHeight, myLabelOffset, myLabelStyle, myObjectStyleName){
    8. Look for the line:
    var myTextFrame = myFrame.parent.textFrames.add(myLabelLayer, undefined, undefined,{geometricBounds:[myY1, myX1, myY2, myX2], contents:myLabel});
    And add the following line after it:
    myTextFrame.applyObjectStyle(app.documents.item(0).objectStyles.item(myObjectStyleName), true);
    9. (Optional) Look for the line:
    myTextFrame.textFramePreferences.firstBaselineOffset = FirstBaseline.leadingOffset;
    And delete it or put "//" in front of it--this will let the object style take care of setting the first baseline offset method.
    After you make these changes, the script adds the object style dropdown to the dialog:
    Thanks,
    Ole

  • Applescript LabelGraphics script error

    When running the provided LabelGraphics applescript I get an error on the line:
    my LabelGraphics of me to {myLabelType, myLabelStyleName, myLabelLayerName, myLabelHeight, myLabelOffset}
    The error is:
    Error number: -2470
    Error string: A to:{myLabelType, myLabelStyleName, myLabelLayerName,myLabelHeight, myLabelOffset}
    can't go after this LabelGraphics of me.
    Does anyone know the proper syntax to get this to work? Thanks!

    I added the lines of script as requested so the script in full now reads as:
    set vpn_ip to do shell script "ifconfig tun0 | grep inet | awk '{print $2}'" # get current ip of vpn interface
    display dialog vpn_id
    set vpn_port to do shell script "curl -d \"user=USERNAME&pass=PASSWORD&client_id=$(cat ~/.pia_client_id)&local_ip=" & vpn_ip & "\"https://www.privateinternetaccess.com/vpninfo/port_forward_assignment 2> /dev/null|grep -oE \"[0-9]+\""
    display dialog vpn_port
    do shell script "defaults delete org.m0k.transmission BindPort" # delete previous port value
    do shell script "defaults write org.m0k.transmission BindPort " & vpn_port & ""
    do shell script "defaults delete org.m0k.transmission BindAddressIPv4" #delete previously written ipv4binding value
    do shell script "defaults write org.m0k.transmission BindAddressIPv4 " & vpn_ip & "" #write current vpn ip into transmission.plist
    (Censored my username and password).
    I run the script and get this error:
    error "The variable vpn_id is not defined." number -2753 from "vpn_id"
    With the first new additional code highlighted "vpn_id".
    display dialog vpn_id
    I created the .pia_client_id file but running a line of code in Terminal (which was detailed in the oringal thread where I found the script). The code I ran in Terminal was:
    head -n 100 /dev/urandom | md5 > ~/.pia_client_id
    Thanks so much for your assistance so far, I really appreciate it.

  • Label graphics script in CS2?

    does anyone know if the LabelGraphics script for CS3 can be modified for use in IDCS2? Any hints on how to do it?
    Thanks
    jon

    Why not try it out and see? You'll find out pretty fast one way or the other. Use a test file.
    Peter

  • Editing An Exisiting Script

    hello, im fairly new to java script and I've only ever used the basic indesign scripts.  I found this very handy script http://www.rorohiko.com/wordpress/otherproducts/sizelabels/ it labels the size (demensions) of every image in the document onto its own layer - its beautiful and i love it.  the only thing i want to do is to add the file name in front of the size in each text box.  is this possible?  ive been trying to incorporate the stock "LabelGraphics" script into this one and I'm having no luck shooting in the dark.  can anyone please help me, i would be so thankful!

    Hi Bishop3,
    The above Kasyan, script will add the document file name.
    If you need add the image name in before the size dimensions, use the below lines.
    If you need this use the below lines. from line #430.
    try{
        labelItem.contents = (pageItem.graphics[0].itemLink.name) +"-"+RoundString(width, kRoundToDecimals) + "x" + RoundString(height, kRoundToDecimals);
        }catch(e){
            labelItem.contents = RoundString(width, kRoundToDecimals) + "x" + RoundString(height, kRoundToDecimals);
    thx
    csm_phil

  • Convert image file names to labels and resizing images according to frame. Possible??

    Hi all,
    I have posted this question hastily in the main mac forum but then i realized it is a scripting question so I repost here.
    Q1: I have a client with 700+ images who has named the images with numbers and the caption:
    eg: 1.II.34. Walking down the road towards the building.tiff
    This is the name of the image file itself
    Is there a way to import the name of the file (possibly without the extension) and place it as a caption under the image without copying and pasting? A script maybe?
    I tried the labelgraphics script. Unfortunately it returned the extension as well. I was given a solution but did not work for me since it deleted everything after the first dot on the name. This was:
    in labelgraphics on line 105, change
    myLabel = myLink.name
    to
    myLabel = myLink.name.split('.')[0]
    So how can we tackle this so it deletes everything after the LAST dot?
    Q2: The image files I am given are all huge tiff files. I use the full 100% of the images but in my document they have to be much smaller . They are usually scaled down to 25-35% of the original file. So I end up with huge, unneeded documents.
    Is there a script that would work together with photoshop maybe?
    It would need to read the frames dimensions the image is in, open the linked file inside photoshop, resize it with a specified interpolation to maybe 110% of the frame's dimensions, set the resolution (if not set) to 300 dpi save the image as a copy (or with a suffix or prefix), leave photoshop open (for the next image to be processed), relink to the new image and go to the next image
    I know it sounds a lot but I was amazed by the issues people handle in this forum and thought I would give it a try
    Thank you in advance
    Michael

    Peter thank you so much. It works like a charm.
    As for Q2, I spent some time doing research and came up with a couple of scripts that sound like they could do the trick.
    a) Image Transform or Rasterize
    http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&loc=en_us&extid=1509 022#
    b) Resample Project Images to 100%
    http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&loc=en_us&extid=1612 518#
    Still, since I am such an ignorant I do not know which one would be the proper one.
    Any suggestions would be highly appreciated.
    Thank you once more
    Michael

  • [CS2][JS] How to scale all inline images to 70%

    To all the script gurus out there. can you help me make a script that scale all inline images to 70%? 'coz we got this client and they supply us with lots of eps files then the instruction would be to reduce the size of all images without touching the original ones. it takes time to process all of them in indesign manually.
    help please.

    Thank you so much guys. I'll try it later. Although I have one more problem. I got this LabelGraphics script from Indesignsecret.com modified for CS2 (originally from CS3), and it works fine for displayed figures but for inline it only labels the figures in first page.
    here's the code:
    //LabelGraphics.jsx
    main();
    //=============================================================\\
    function main(){
    if(app.documents.length != 0){
    if(app.documents.item(0).allGraphics.length != 0){
    myDisplayDialog();
    else{
    alert("Document contains no graphics.");
    else{
    alert("Please open a document and try again.");
    //=============================================================\\
    function myDisplayDialog(){
    var myLabelWidth = 100;
    var myStyleNames = myGetParagraphStyleNames();
    var myDialog = app.dialogs.add({name:"Graphics name"});
    with(myDialog.dialogColumns.add()){
    //Label type
    with(dialogRows.add()){
    with(dialogColumns.add()){
    staticTexts.add({staticLabel:"Label Type", minWidth:myLabelWidth});
    with(dialogColumns.add()){
    var myLabelTypeDropdown = dropdowns.add({stringList:["File name", "File path", "XMP description", "XMP author","Paste from clipboard"], selectedIndex:0});
    with(dialogRows.add()){
    with(dialogColumns.add()){
    staticTexts.add({staticLabel:"Label Offset", minWidth:myLabelWidth});
    with(dialogColumns.add()){
    var myLabelOffsetField = measurementEditboxes.add({editValue:0});
    //Style to apply
    with(dialogRows.add()){
    with(dialogColumns.add()){
    staticTexts.add({staticLabel:"Label Style", minWidth:myLabelWidth});
    with(dialogColumns.add()){
    var myLabelStyleDropdown = dropdowns.add({stringList:myStyleNames, selectedIndex:4});
    //=============================================================\\
    var myResult = myDialog.show();
    if(myResult == true){
    var myLabelType = myLabelTypeDropdown.selectedIndex;
    var myLabelHeight = 24; // A generic label height that will be adjusted later
    myPasteFailure = false;
    var myLabelOffset = myLabelOffsetField.editValue;
    var myLabelStyle = myStyleNames[myLabelStyleDropdown.selectedIndex];
    myDialog.destroy();
    var myOldXUnits = app.documents.item(0).viewPreferences.horizontalMeasurementUnits;
    var myOldYUnits = app.documents.item(0).viewPreferences.verticalMeasurementUnits;
    app.documents.item(0).viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;
    app.documents.item(0).viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;
    try{
    myAddLabels(myLabelType, myLabelHeight, myLabelOffset, myLabelStyle);
    catch(e){
    alert("Unable to add lables. " + e);
    try{
    resizeOverset() ;
    catch(e){
    alert("Unable to correct overset text. " + e);
    if (myPasteFailure == true){
    alert("Unable to paste from clipboard.");
    app.documents.item(0).viewPreferences.horizontalMeasurementUnits = myOldXUnits;
    app.documents.item(0).viewPreferences.verticalMeasurementUnits = myOldYUnits;
    else{
    myDialog.destroy();
    //=============================================================\\
    function myAddLabels(myLabelType, myLabelHeight, myLabelOffset, myLabelStyleName){
    var myDocument = app.documents.item(0);
    myStoriesArray = new Array();
    if (app.selection.length == 0) // If nothing is selected apply caption to all graphics in the document
    var myConfirmation = confirm("Add captions to all images in the document?", false, "LabelGraphics.jsx" );
    if (myConfirmation == true)
    var myGraphics = myDocument.allGraphics;
    else
    { // If graphics are selected, just add captions to the selected items, as long as they are rectangles(image frames)
    var myConfirmation = true;
    var mySelections = app.selection;
    myGraphics = new Array();
    for(i = 0; i < mySelections.length; i++){
    if(mySelections[i] == "[object Rectangle]"){ //Check to make sure selection only includes rectangles
    myGraphics.push(mySelections[i].allGraphics[0]);
    else{
    //alert("Objects other than graphics were selected!");
    //Nothing happens if you don't select at least one graphic
    myLabelStyle = myDocument.paragraphStyles.item(myLabelStyleName);
    if (myConfirmation == true){
    for(var myCounter = 0; myCounter < myGraphics.length; myCounter++){
    try{
    myAddLabel(myDocument, myGraphics[myCounter], myLabelType, myLabelHeight, myLabelOffset, myLabelStyle, myStoriesArray);
    catch(e){};
    //=============================================================\\
    function myAddLabel(myDocument, myGraphic, myLabelType, myLabelHeight, myLabelOffset, myLabelStyle, myStoriesArray){
    var myLabel;
    var myLink = myGraphic.itemLink;
    var myPasteFromClipboard = false;
    //Create the label layer if it does not already exist.
    var myLabelLayer = myDocument.layers.item("Grapiks");
    try{
    myLabelLayer.name;
    catch (myError){
    myLabelLayer = myDocument.layers.add({name:"Grapiks"});
    //Label type defines the text that goes in the label.
    switch(myLabelType){
    //File name
    case 0:
    myLabel = myLink.name;
    break;
    //File path
    case 1:
    myLabel = myLink.filePath;
    break;
    //XMP description
    case 2:
    try{
    myLabel = myLink.linkXmp.description;
    catch(myError){
    myLabel = "No description available.";
    break;
    //XMP author
    case 3:
    try{
    myLabel = myLink.linkXmp.author
    catch(myError){
    myLabel = "No author available.";
    break;
    //Paste from the clipboard
    case 4:
    try{
    myPasteFromClipboard = true;
    catch(myError){
    myLabel = "No clipboard data available.";
    break;
    var myFrame = myGraphic.parent;
    myX1 = myFrame.geometricBounds[1];
    myY1 = myFrame.geometricBounds[2] + myLabelOffset;
    myX2 = myFrame.geometricBounds[3];
    myY2 = myY1 + myLabelHeight;
    if (myPasteFromClipboard ==true)
    try{
    var myTextFrame = myFrame.parent.textFrames.add(myLabelLayer, undefined, undefined,{geometricBounds:[myY1, myX1, myY2, myX2]});
    myTextFrame.insertionPoints.item(0).select();
    app.paste();
    catch(e){
    myTextFrame.remove();
    myPasteFailure = true;
    else{
    var myTextFrame = myFrame.parent.textFrames.add(myLabelLayer, undefined, undefined,{geometricBounds:[myY1, myX1, myY2, myX2], contents:myLabel});
    myTextFrame.textFramePreferences.firstBaselineOffset = FirstBaseline.leadingOffset;
    myTextFrame.paragraphs.item(0).appliedParagraphStyle = myLabelStyle;
    myFrameParentStory = myTextFrame.parentStory;
    myStoriesArray.push(myFrameParentStory);
    //=============================================================\\
    function myGetParagraphStyleNames(){
    var myStyleNames = app.documents.item(0).paragraphStyles.everyItem().name;
    return myStyleNames;
    function resizeOverset() {
    for (var j = myStoriesArray.length - 1; j >= 0; j--) {
    myLastFrame = myStoriesArray[j].texts[0].parentTextFrames[myStoriesArray[j].texts[0].parentTextFrames.l ength - 1];
    myNewY2 = myLastFrame.geometricBounds[3]; //get the width of the text frame before doing fit()
    myLastFrame.fit(FitOptions.FRAME_TO_CONTENT);
    myNewY1 = myLastFrame.geometricBounds[1];
    myNewX1 = myLastFrame.geometricBounds[2];
    myNewX2 = myLastFrame.geometricBounds[0];

  • Quicker/more effecient way to generate captions?

    Is there a way to automatically generate captions when I'm placing a new image? Right now, the only option is to either place the caption right after I place the image or to generate a caption afterwards -- there's no option to automatically place it with the image itself.
    Additionally - has anyone come up with a script that allows a keyboard shorcut that generates a static caption? It would be nice if Adobe came up with these..

    There's 'LabelGraphics' script create captions for all the images in your document, i test it with indesign cs6 and it work fine.
    see link:
    http://indesignsecrets.com/modified-script-adds-captions-from-clipboard-to-images.php

  • Label Script

    This script is for Adobe Indesign CS5 Windows.
    I´m trying change this script to acept this setup:
    Dispensing this dialog box and apply just if there is some selected image frame. (I think if there is no selected object, this will apply it to all image frame in page so I don´t wanna this couse I will use a shortcut to this script and accidents can occur)
    Sorry for long script.
    //LabelGraphics.jsx (Modified)
    //An InDesign CS3 JavaScript
    @@@BUILDINFO@@@ "LabelGraphics.jsx" 1.1.0 6-June-2008
    //Adds labels to the graphics in the active document.
    /* This sample script has been modified. The modications are listed here: option added to create a label from clipboard data,
      dropdown menu added to apply a swatch to the caption frame. This script can now apply lables to just the selected graphics
      if you have one or more images selected. Otherwise it will apply the lables to all graphics in the document. The hieght of the
      caption frame is determined by the amount of text, and paragraph style applied. the width of the caption frame is
      determined by the width of the graphic it is under. Setting the caption height in the dialog box has been removed, as it is no
      longer needed.
    main();
    //=============================================================\\
    function main(){
      if(app.documents.length != 0){
      if(app.documents.item(0).allGraphics.length != 0){
      myDisplayDialog();
      else{
      alert("Document contains no graphics.");
      else{
      alert("Please open a document and try again.");
    //=============================================================\\
    function myDisplayDialog(){
      var myLabelWidth = 100;
      var myStyleNames = myGetParagraphStyleNames();
      var mySwatchNames = myGetSwatchNames();
      var myDialog = app.dialogs.add({name:"LabelGraphics"});
      with(myDialog.dialogColumns.add()){
      //Label type
      with(dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Label Type", minWidth:myLabelWidth});
      with(dialogColumns.add()){
      var myLabelTypeDropdown = dropdowns.add({stringList:["File name", "File path", "XMP description", "XMP author","Paste from clipboard"], selectedIndex:4});
      with(dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Label Offset", minWidth:myLabelWidth});
      with(dialogColumns.add()){
      var myLabelOffsetField = measurementEditboxes.add({editValue:0});
      //Style to apply
      with(dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Label Style", minWidth:myLabelWidth});
      with(dialogColumns.add()){
      var myLabelStyleDropdown = dropdowns.add({stringList:myStyleNames, selectedIndex:0});
      //Swatch to apply
      with(dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Apply swatch", minWidth:myLabelWidth});
      with(dialogColumns.add()){
      var mySwatchDropdown = dropdowns.add({stringList:mySwatchNames, selectedIndex:0});
    //=============================================================\\
      var myResult = myDialog.show();
      if(myResult == true){
      var myLabelType = myLabelTypeDropdown.selectedIndex;
      var myLabelHeight = 24; // A generic label height that will be adjusted later
      myPasteFailure = false;
      var myLabelOffset = myLabelOffsetField.editValue;
      var myLabelStyle = myStyleNames[myLabelStyleDropdown.selectedIndex];
      var mySwatch = mySwatchNames[mySwatchDropdown.selectedIndex];
      myDialog.destroy();
      var myOldXUnits = app.documents.item(0).viewPreferences.horizontalMeasurementUnits;
      var myOldYUnits = app.documents.item(0).viewPreferences.verticalMeasurementUnits;
      app.documents.item(0).viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;
      app.documents.item(0).viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;
      try{
      myAddLabels(myLabelType, myLabelHeight, myLabelOffset, myLabelStyle, mySwatch);
      catch(e){
      alert("Unable to add lables. " + e);
      try{
      resizeOverset() ;
      catch(e){
      alert("Unable to correct overset text. " + e);
      if (myPasteFailure == true){
      alert("Unable to paste from clipboard.");
      app.documents.item(0).viewPreferences.horizontalMeasurementUnits = myOldXUnits;
      app.documents.item(0).viewPreferences.verticalMeasurementUnits = myOldYUnits;
      else{
      myDialog.destroy();
    //=============================================================\\
    function myAddLabels(myLabelType, myLabelHeight, myLabelOffset, myLabelStyleName, mySwatchName){
      var myDocument = app.documents.item(0);
      myStoriesArray = new Array();
      if (app.selection.length == 0) // If nothing is selected apply caption to all graphics in the document
      var myConfirmation = confirm("Add captions to all images in the document?", false, "LabelGraphics.jsx" );
      if (myConfirmation == true)
      var myGraphics = myDocument.allGraphics;
      else
      { // If graphics are selected, just add captions to the selected items, as long as they are rectangles(image frames)
      var myConfirmation = true;
      var mySelections = app.selection;
      myGraphics = new Array();
      for(i = 0; i < mySelections.length; i++){
      if(mySelections[i] == "[object Rectangle]"){   //Check to make sure selection only includes rectangles
      myGraphics.push(mySelections[i].allGraphics[0]);
      else{
      //alert("Objects other than graphics were selected!");
      //Nothing happens if you don't select at least one graphic
      myLabelStyle = myDocument.paragraphStyles.item(myLabelStyleName);
      mySwatch = myDocument.swatches.item(mySwatchName);
      if (myConfirmation == true){
      for(var myCounter = 0; myCounter < myGraphics.length; myCounter++){
      try{
      myAddLabel(myDocument, myGraphics[myCounter], myLabelType, myLabelHeight, myLabelOffset, myLabelStyle, mySwatch, myStoriesArray);
      catch(e){};
    //=============================================================\\
    function myAddLabel(myDocument, myGraphic, myLabelType, myLabelHeight, myLabelOffset, myLabelStyle, mySwatch, myStoriesArray){
      var myLabel;
      var myLink = myGraphic.itemLink;
      var myPasteFromClipboard = false;
      //Create the label layer if it does not already exist.
      var myLabelLayer = myDocument.layers.item("labels");
      try{
      myLabelLayer.name;
      catch (myError){
      myLabelLayer = myDocument.layers.add({name:"labels"});
      //Label type defines the text that goes in the label.
      switch(myLabelType){
      //File name
      case 0:
      myLabel = myLink.name;
      break;
      //File path
      case 1:
      myLabel = myLink.filePath;
      break;
      //XMP description
      case 2:
      try{
      myLabel = myLink.linkXmp.description;
      catch(myError){
      myLabel = "No description available.";
      break;
      //XMP author
      case 3:
      try{
      myLabel = myLink.linkXmp.author
      catch(myError){
      myLabel = "No author available.";
      break;
      //Paste from the clipboard
      case 4:
      try{
      myPasteFromClipboard = true;
      catch(myError){
      myLabel = "No clipboard data available.";
      break;
      var myFrame = myGraphic.parent;
      myX1 = myFrame.geometricBounds[1];
      myY1 = myFrame.geometricBounds[2] + myLabelOffset;
      myX2 = myFrame.geometricBounds[3];
      myY2 = myY1 + myLabelHeight;
      if (myPasteFromClipboard ==true)
      try{
      var myTextFrame = myFrame.parent.textFrames.add(myLabelLayer, undefined, undefined,{geometricBounds:[myY1, myX1, myY2, myX2]});
      myTextFrame.insertionPoints.item(0).select();
      app.paste();
      catch(e){
      myTextFrame.remove();
      myPasteFailure = true;
      else{
      var myTextFrame = myFrame.parent.textFrames.add(myLabelLayer, undefined, undefined,{geometricBounds:[myY1, myX1, myY2, myX2], contents:myLabel});
      myTextFrame.textFramePreferences.firstBaselineOffset = FirstBaseline.leadingOffset;
      myTextFrame.paragraphs.item(0).appliedParagraphStyle = myLabelStyle;
      myTextFrame.fillColor = mySwatch;
      myFrameParentStory = myTextFrame.parentStory;
      myStoriesArray.push(myFrameParentStory);
    //=============================================================\\
    function myGetParagraphStyleNames(){
      var myStyleNames = app.documents.item(0).paragraphStyles.everyItem().name;
      return myStyleNames;
    function myGetSwatchNames(){
      var mySwatchNames = app.documents.item(0).swatches.everyItem().name;
      return mySwatchNames;
    function resizeOverset() {
                for (var j = myStoriesArray.length - 1; j >= 0; j--) {
                        myLastFrame = myStoriesArray[j].texts[0].parentTextFrames[myStoriesArray[j].texts[0].parentTextFrames.l ength - 1];
      myNewY2 = myLastFrame.geometricBounds[3]; //get the width of the text frame before doing fit()
      myLastFrame.fit(FitOptions.FRAME_TO_CONTENT);
      myNewY1 = myLastFrame.geometricBounds[1];
      myNewX1 = myLastFrame.geometricBounds[2];
      myNewX2 = myLastFrame.geometricBounds[0];
      myLastFrame.geometricBounds = [myNewX1, myNewY1, myNewX2, myNewY2]; // reset the width to before fit() was ran

    Hi,
    Function runWithoutDialog() added - permanent sets inside:
    //LabelGraphics.jsx (Modified)
    //An InDesign CS5 JavaScript
    @@@BUILDINFO@@@ "LabelGraphics.jsx" 1-Dec-2014
    //Adds labels to the graphics in the active document.
    /* User interaction switched off
      see settings inside runWithoutDialog() function
    main();
    //=============================================================\\
    function main(){
      myStoriesArray = new Array();
      if(app.documents.length != 0){
      if(app.selection[0].allGraphics.length != 0){
      runWithoutDialog(); // myDisplayDialog();
      else{
      alert("Select some frame with graphic");
      else{
      alert("Please open a document and try again.");
    //=============================================================\\
    function runWithoutDialog(){
      var myLabelWidth = 100;
      var myStyleNames = myGetParagraphStyleNames();
      var mySwatchNames = myGetSwatchNames();
      var myLabelType = 4; // paste from clipboard
      var myLabelHeight = 24; // A generic label height that will be adjusted later
      myPasteFailure = false;
      var myLabelOffset = 0;
      var myLabelStyle = myStyleNames[0];
      var mySwatch = mySwatchNames[0];
      var myOldXUnits = app.documents.item(0).viewPreferences.horizontalMeasurementUnits;
      var myOldYUnits = app.documents.item(0).viewPreferences.verticalMeasurementUnits;
      app.documents.item(0).viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;
      app.documents.item(0).viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;
      try{
      myAddLabels(myLabelType, myLabelHeight, myLabelOffset, myLabelStyle, mySwatch);
      catch(e){
      alert("Unable to add lables. " + e);
      try{
      resizeOverset() ;
      catch(e){
      alert("Unable to correct overset text. " + e);
      if (myPasteFailure == true){
      alert("Unable to paste from clipboard.");
      app.documents.item(0).viewPreferences.horizontalMeasurementUnits = myOldXUnits;
      app.documents.item(0).viewPreferences.verticalMeasurementUnits = myOldYUnits;
    //=============================================================\\
    function myDisplayDialog(){
      var myLabelWidth = 100;
      var myStyleNames = myGetParagraphStyleNames();
      var mySwatchNames = myGetSwatchNames();
      var myDialog = app.dialogs.add({name:"LabelGraphics"});
      with(myDialog.dialogColumns.add()){
      //Label type
      with(dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Label Type", minWidth:myLabelWidth});
      with(dialogColumns.add()){
      var myLabelTypeDropdown = dropdowns.add({stringList:["File name", "File path", "XMP description", "XMP author","Paste from clipboard"], selectedIndex:4});
      with(dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Label Offset", minWidth:myLabelWidth});
      with(dialogColumns.add()){
      var myLabelOffsetField = measurementEditboxes.add({editValue:0});
      //Style to apply
      with(dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Label Style", minWidth:myLabelWidth});
      with(dialogColumns.add()){
      var myLabelStyleDropdown = dropdowns.add({stringList:myStyleNames, selectedIndex:0});
      //Swatch to apply
      with(dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Apply swatch", minWidth:myLabelWidth});
      with(dialogColumns.add()){
      var mySwatchDropdown = dropdowns.add({stringList:mySwatchNames, selectedIndex:0});
      //=============================================================\\
      var myResult = myDialog.show();
      if(myResult == true){
      var myLabelType = myLabelTypeDropdown.selectedIndex;
      var myLabelHeight = 24; // A generic label height that will be adjusted later
      myPasteFailure = false;
      var myLabelOffset = myLabelOffsetField.editValue;
      var myLabelStyle = myStyleNames[myLabelStyleDropdown.selectedIndex];
      var mySwatch = mySwatchNames[mySwatchDropdown.selectedIndex];
      myDialog.destroy();
      var myOldXUnits = app.documents.item(0).viewPreferences.horizontalMeasurementUnits;
      var myOldYUnits = app.documents.item(0).viewPreferences.verticalMeasurementUnits;
      app.documents.item(0).viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;
      app.documents.item(0).viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;
      try{
      myAddLabels(myLabelType, myLabelHeight, myLabelOffset, myLabelStyle, mySwatch);
      catch(e){
      alert("Unable to add lables. " + e);
      try{
      resizeOverset() ;
      catch(e){
      alert("Unable to correct overset text. " + e);
      if (myPasteFailure == true){
      alert("Unable to paste from clipboard.");
      app.documents.item(0).viewPreferences.horizontalMeasurementUnits = myOldXUnits;
      app.documents.item(0).viewPreferences.verticalMeasurementUnits = myOldYUnits;
      else{
      myDialog.destroy();
    //=============================================================\\
    function myAddLabels(myLabelType, myLabelHeight, myLabelOffset, myLabelStyleName, mySwatchName){
      var myDocument = app.documents.item(0);
      if (app.selection.length == 0) // If nothing is selected apply caption to all graphics in the document
      var myConfirmation = false; // confirm("Add captions to all images in the document?", false, "LabelGraphics.jsx" );
      if (myConfirmation == true)
      var myGraphics = myDocument.allGraphics;
      else
      { // If graphics are selected, just add captions to the selected items, as long as they are rectangles(image frames)
      var myConfirmation = true;
      var mySelections = app.selection;
      myGraphics = new Array();
      for(i = 0; i < mySelections.length; i++){
      if(mySelections[i] == "[object Rectangle]"){  //Check to make sure selection only includes rectangles
      myGraphics.push(mySelections[i].allGraphics[0]);
      else{
      //alert("Objects other than graphics were selected!");
      //Nothing happens if you don't select at least one graphic
      myLabelStyle = myDocument.paragraphStyles.item(myLabelStyleName);
      mySwatch = myDocument.swatches.item(mySwatchName);
      if (myConfirmation == true){
      for(var myCounter = 0; myCounter < myGraphics.length; myCounter++){
      try{
      myAddLabel(myDocument, myGraphics[myCounter], myLabelType, myLabelHeight, myLabelOffset, myLabelStyle, mySwatch, myStoriesArray);
      catch(e){};
    //=============================================================\\
    function myAddLabel(myDocument, myGraphic, myLabelType, myLabelHeight, myLabelOffset, myLabelStyle, mySwatch, myStoriesArray){
      var myLabel;
      var myLink = myGraphic.itemLink;
      var myPasteFromClipboard = false;
      //Create the label layer if it does not already exist.
      var myLabelLayer = myDocument.layers.item("labels");
      try{
      myLabelLayer.name;
      catch (myError){
      myLabelLayer = myDocument.layers.add({name:"labels"});
      //Label type defines the text that goes in the label.
      switch(myLabelType){
      //File name
      case 0:
      myLabel = myLink.name;
      break;
      //File path
      case 1:
      myLabel = myLink.filePath;
      break;
      //XMP description
      case 2:
      try{
      myLabel = myLink.linkXmp.description;
      catch(myError){
      myLabel = "No description available.";
      break;
      //XMP author
      case 3:
      try{
      myLabel = myLink.linkXmp.author
      catch(myError){
      myLabel = "No author available.";
      break;
      //Paste from the clipboard
      case 4:
      try{
      myPasteFromClipboard = true;
      catch(myError){
      myLabel = "No clipboard data available.";
      break;
      var myFrame = myGraphic.parent;
      myX1 = myFrame.geometricBounds[1];
      myY1 = myFrame.geometricBounds[2] + myLabelOffset;
      myX2 = myFrame.geometricBounds[3];
      myY2 = myY1 + myLabelHeight;
      if (myPasteFromClipboard ==true)
      try{
      var myTextFrame = myFrame.parent.textFrames.add(myLabelLayer, undefined, undefined,{geometricBounds:[myY1, myX1, myY2, myX2]});
      myTextFrame.insertionPoints.item(0).select();
      app.paste();
      catch(e){
      myTextFrame.remove();
      myPasteFailure = true;
      else{
      var myTextFrame = myFrame.parent.textFrames.add(myLabelLayer, undefined, undefined,{geometricBounds:[myY1, myX1, myY2, myX2], contents:myLabel});
      myTextFrame.textFramePreferences.firstBaselineOffset = FirstBaseline.leadingOffset;
      myTextFrame.paragraphs.item(0).appliedParagraphStyle = myLabelStyle;
      myTextFrame.fillColor = mySwatch;
      myFrameParentStory = myTextFrame.parentStory;
      myStoriesArray.push(myFrameParentStory);
    //=============================================================\\
    function myGetParagraphStyleNames(){
      var myStyleNames = app.documents.item(0).paragraphStyles.everyItem().name;
      return myStyleNames;
    function myGetSwatchNames(){
      var mySwatchNames = app.documents.item(0).swatches.everyItem().name;
      return mySwatchNames;
    function resizeOverset() {
      for (var j = myStoriesArray.length - 1; j >= 0; j--) {
      myLastFrame = myStoriesArray[j].texts[0].parentTextFrames[myStoriesArray[j].texts[0].parentTextFrames.length - 1];
      myNewY2 = myLastFrame.geometricBounds[3]; //get the width of the text frame before doing fit()
      myLastFrame.fit(FitOptions.FRAME_TO_CONTENT);
      myNewY1 = myLastFrame.geometricBounds[1];
      myNewX1 = myLastFrame.geometricBounds[2];
      myNewX2 = myLastFrame.geometricBounds[0];
      myLastFrame.geometricBounds = [myNewX1, myNewY1, myNewX2, myNewY2]; // reset the width to before fit() was ran

  • Editing LabelGraphic Script

    Is there any chance someone can help me out or point me in the right direction on small script edit? I am not terribly familiar with Javascript and I just started testing the Javascript version of the LabelGraphics option in Indesign CS3. This works pretty well for me, but I am wondering if it can be edited to make the label text box have a white fill background. I am using this for print grids and need it to show over an image.

    Hi AlliantPrinting,
    The CS4 version has an option to apply an object style, and it should work in CS3. You can get it from:
    http://www.adobe.com/products/indesign/scripting/index.html
    (click the Scripting Resources) tab to get to the scripting page. The CS4 sample scripts are posted there for download. Let me know if it works for you!
    Thanks,
    Ole

  • Modify LabelGraphics.js to extract other XMP metadata from images

    This script works flawlessly. However, I would like to be able to extract other XMP metadata than just
    //XMP description
            case 2:
                try{
                    myLabel = myLink.linkXmp.description;
                catch(myError){
                    myLabel = "No description available.";
                break;
            //XMP author
            case 3:
                try{
                    myLabel = myLink.linkXmp.author
                catch(myError){
                    myLabel = "No author available.";
    I have developed a custom info panel (based on the generic one) with following "properties.xml":
    <xmp_definitions xmlns:ui="http://ns.adobe.com/xmp/fileinfo/ui/">
        <xmp_schema prefix="custom0" namespace="http://my.custom0.namespace/" label="$$$/Custom0/Schema/Label=Ref_SAP" description="$$$/Custom0/Schema/Description=This example panel contains most of the options available for the 'Generic Panel'.">
            <!-- simple properties -->
            <xmp_property name="Ref_SAP" category="external" label="$$$/Custom0/Property/TextInputLabel=Referentie nummer SAP:" type="integer"/>
            <ui:separator/>
        </xmp_schema>
        <xmp_schema prefix="custom1" namespace="http://my.custom1.namespace/" label="$$$/Custom1/Schema/Label=FRANS" description="$$$/Custom1/Schema/Description=This example panel contains most of the options available for the 'Generic Panel'.">
            <!-- simple properties -->
            <xmp_property name="Titel_FR" category="external" label="$$$/Custom1/Property/TextInputLabel=Titel FR:" type="text"/>
            <xmp_property name="Tekst_FR" category="external" label="$$$/Custom1/Property/TextInputML_Label=Tekst FR:" type="text" ui:multiLine="true" ui:height="100"/>
            <ui:separator/>
        </xmp_schema>
        <xmp_schema prefix="custom2" namespace="http://my.custom2.namespace/" label="$$$/Custom2/Schema/Label=VLAAMS" description="$$$/Custom2/Schema/Description=This example panel contains most of the options available for the 'Generic Panel'.">
            <xmp_property name="Titel_VL" category="external" label="$$$/Custom2/Property/TextInputLabel=Titel VL:" type="text"/>
            <xmp_property name="Tekst_VL" category="external" label="$$$/Custom2/Property/TextInputML_Label=Tekst VL:" type="text" ui:multiLine="true" ui:height="100"/>
            <ui:separator/>
        </xmp_schema>
        <xmp_schema prefix="custom3" namespace="http://my.custom3.namespace/" label="$$$/Custom3/Schema/Label=NEDERLANDS" description="$$$/Custom3/Schema/Description=This example panel contains most of the options available for the 'Generic Panel'.">
            <xmp_property name="Titel_NL" category="external" label="$$$/Custom3/Property/TextInputLabel=Titel NL:" type="text"/>
            <xmp_property name="Tekst_NL" category="external" label="$$$/Custom3/Property/TextInputML_Label=Tekst NL:" type="text" ui:multiLine="true" ui:height="100"/>
            <ui:separator/>
        </xmp_schema>
    </xmp_definitions>
    Now I would like to adapt the LabelGraphics.js to retrieve the information stored in the fields "Titel_FR", "Tekst_FR", "Titel_VL", "Tekst_VL", "Titel_NL", Text_NL". These fields contain fixed text that goes with the image and should be retrieved in several "goes".
    Question 1: is this possible at all ?
    Question 2: how to proceed ?

    Have you already found Marijan Tompa's "Extract Metadata with Adobe XMP"?
    David

  • How to modify labelgraphics.jsx to read custom metadata

    This script works flawlessly. However, I would like to be able to extract other XMP metadata than just
    //XMP description
            case 2:
                try{
                    myLabel = myLink.linkXmp.description;
                catch(myError){
                    myLabel = "No description available.";
                break;
            //XMP author
            case 3:
                try{
                    myLabel = myLink.linkXmp.author
                catch(myError){
                    myLabel = "No author available.";
    I have developed a custom info panel (based on the generic one) with following "properties.xml":
    <xmp_definitions xmlns:ui="http://ns.adobe.com/xmp/fileinfo/ui/">
        <xmp_schema prefix="custom0" namespace="http://my.custom0.namespace/" label="$$$/Custom0/Schema/Label=Ref_SAP" description="$$$/Custom0/Schema/Description=This example panel contains most of the options available for the 'Generic Panel'.">
            <!-- simple properties -->
            <xmp_property name="Ref_SAP" category="external" label="$$$/Custom0/Property/TextInputLabel=Referentie nummer SAP:" type="integer"/>
            <ui:separator/>
        </xmp_schema>
        <xmp_schema prefix="custom1" namespace="http://my.custom1.namespace/" label="$$$/Custom1/Schema/Label=FRANS" description="$$$/Custom1/Schema/Description=This example panel contains most of the options available for the 'Generic Panel'.">
            <!-- simple properties -->
            <xmp_property name="Titel_FR" category="external" label="$$$/Custom1/Property/TextInputLabel=Titel FR:" type="text"/>
            <xmp_property name="Tekst_FR" category="external" label="$$$/Custom1/Property/TextInputML_Label=Tekst FR:" type="text" ui:multiLine="true" ui:height="100"/>
            <ui:separator/>
        </xmp_schema>
        <xmp_schema prefix="custom2" namespace="http://my.custom2.namespace/" label="$$$/Custom2/Schema/Label=VLAAMS" description="$$$/Custom2/Schema/Description=This example panel contains most of the options available for the 'Generic Panel'.">
            <xmp_property name="Titel_VL" category="external" label="$$$/Custom2/Property/TextInputLabel=Titel VL:" type="text"/>
            <xmp_property name="Tekst_VL" category="external" label="$$$/Custom2/Property/TextInputML_Label=Tekst VL:" type="text" ui:multiLine="true" ui:height="100"/>
            <ui:separator/>
        </xmp_schema>
        <xmp_schema prefix="custom3" namespace="http://my.custom3.namespace/" label="$$$/Custom3/Schema/Label=NEDERLANDS" description="$$$/Custom3/Schema/Description=This example panel contains most of the options available for the 'Generic Panel'.">
            <xmp_property name="Titel_NL" category="external" label="$$$/Custom3/Property/TextInputLabel=Titel NL:" type="text"/>
            <xmp_property name="Tekst_NL" category="external" label="$$$/Custom3/Property/TextInputML_Label=Tekst NL:" type="text" ui:multiLine="true" ui:height="100"/>
            <ui:separator/>
        </xmp_schema>
    </xmp_definitions>
    Now I would like to adapt the LabelGraphics.js to retrieve the information stored in the fields "Titel_FR", "Tekst_FR", "Titel_VL", "Tekst_VL", "Titel_NL", Text_NL". These fields contain fixed text that goes with the image and should be retrieved in several "goes".
    Question 1: is this possible at all ?
    Question 2: how to proceed ?

    Have you already found Marijan Tompa's "Extract Metadata with Adobe XMP"?
    David

  • CS3 strange order with LabelGraphics.jsx

    Hi all,
    I am experiencing a strange behavior with LabelGraphics.
    I can not figure how to make the script use a defined list in conjunction with a paragraph style to properly number the images from the beginning of the document downwards (or even continue across an InDesign book).
    Any ideas?
    Thanx in advance
    Michael

    to Olav,
    Thanx for letting me realise that it is not a problem from my side. I went on and tried the change you suggested and it worked as you predicted. It does not give consistent results. I gets all mixed up when I had more than 3 images on a page.
    to loic,
    I think that scripting is about cheating. You get to execute mountainous tasks with just one click. I can fully understand your way of thinking. I do not think I could reorder the paragraphs or relink the text frames since I work with long documents in autoflow (chapters of 50+ pages)
    The way I see it it would have to be one of two ways.
    Either 1. A topleft - bottomright approach, or
    2. A gravity like approach. This way the script would "hit" the highest on the page image going to the lower and so on.
    So could you please elaborate on your solution? And when I say elaborate I mean provide the copy/paste I would have to apply since I do not know scripting?
    It would be great if it worked.
    Thanx to both
    Michael

  • Graphics to Buttons Script

    Hi,
    I need a script that does the same thing as the sample script "LabelGraphics.jsx" that comes bundled with InDesignCS3
    that instead of labeling all the graphics with the original file name
    creates buttons that link to the original files (kind of a ImageBank).
    Any help is mostly appreciated!
    Cheers

    loic,
    I guess you could make a lot simpler in just putting a ne button on top of the image on its own layer. Thus you do not need to unscramble any group structures etc. You simply go through the list of links, get the parent of the parent (i.e. the frame) and use its geometric bounds to create a new button.
    This seems to work in my tests:
    // buttons_on_images.jsx
    // © Gerald Singelmann, 08/2008
    // Zur Erstellung von Bildkatalogen.
    // Legt auf jedes Bild eine gleich große, farblose Schaltfläche, die einen Link auf das Bild enthält
    // So können die Bilder aus Acrobat heraus direkt in Photoshop / Illustrator geöffnet werden
    // Gebrauch wie immer auf eigene Gefahr,
    // wir können nicht garantieren, dass das Script nicht mal unerwartete Ergebnisse erzeugt
    main();
    function main() {
      var aDoc = app.documents[0];
      var allLinks = aDoc.links;
      var noSwatch = aDoc.swatches.itemByName("None");
      try {
        var bLayer = aDoc.layers.itemByName("Buttons");
        var t = bLayer.name;
      } catch (e) {
        var bLayer = aDoc.layers.add();
        bLayer.name = "Buttons";
      for (var n = 0; n < allLinks.length; n++) {
        var aLink = allLinks[n];
        var aFrame = aLink.parent.parent;
        var aPage = getPage(aFrame);
        if (aPage != false) {
          var aButton = aPage.buttons.add();
          with (aButton) {
            itemLayer = bLayer;
            geometricBounds =aFrame.geometricBounds;
            fillColor = noSwatch;
            strokeColor = noSwatch;
          var oBH = aButton.openFileBehaviors.add()
          with (oBH) {
            behaviorEvent = BehaviorEvents.MOUSE_UP;
            enableBehavior = true;
            filePath = aLink.filePath;
    function getPage(aThing) {
      var aClass = aThing.constructor.name;
      switch (aClass) {
        case "Page":
        case "Spread":
        case "MasterSpread":
          return aThing;
        case "Document":
          return false;
        case "Text":
        case "InsertionPoint":
        case "Character":
        case "Word":
        case "TextStyleRange":
        case "Line":
        case "Paragraph":
        case "TextColumn":
          return getPage(aThing.parentTextFrames[0]);
        default:
          return getPage(aThing.parent);

  • How to delete the members in one dimension use the maxl script

    i have question that i want to delete the members in one dimension useing the maxl script, but i do not know how to do it. can the maxl delete the members in one dimension? if can, please provide an sample script, thank you so mcuh.

    MaxL does not have commands to alter an outline directly, except the reset command which can delete all dimensions but not members selectively. The best you could do would be to run a rules file (import dimensions) using a file that contains the members you want to keepload rule for the dimension. As typical the warning is to test this first before you do it on a production database

Maybe you are looking for

  • How to populate the SOAP Header in JCD/BP while consuming WebService?

    Hello, I am trying to invoke a external webservice through both JCD/BP in JCAPS513 and as per wsdl defination we need to send user and token information in the SOAP Header. When I imported the WebService defination into the JCDP/BP, I do not see mess

  • "Organize Bookmarks" does not appear under Bookmarks menu, even though Help advises to go there.

    I've needed to eliminate Bookmarks. Because I have no "Organize Bookmarks" or "Manage Bookmarks" option under the Bookmarks menu, I've tried dragging bookmarks off the list onto my desktop. I've tried right-clicking to get a "delete" option (but ther

  • XI software

    Dear all,          I am into BASIS, i am new to XI. I have some queries in XI: 1.  Is that can I download XI trail version from service market place(I have Suser ID). 2.  Do i need to install ABAP+JAVA kernel of IDES ERP6.0 ECC6.0 SR3.(At present I h

  • Direct database data access without data level authorization check

    Hello, My customer raised issue about direct database data access. Due to the customeru2019s strong security policy, it shouldnu2019t be allowed. To prevent this kind of illegal data access, customer ask me to list up all the possibilities to display

  • Does anyone have some wizzy code or bright ideas?

    I have a string variable - varchar2(240) maximum - which is arbitarily filled with 3 letter codes. Any one or more of these codes may be duplicated within the string. What I need to do is to strip out all the duplications and end up with a single con