Skip navigation
Currently Being Moderated

Script to Export and Import Keywords and Metadata

Aug 2, 2005 9:02 AM

I have a requirement to mass upload and download keywords and various metadata fields (i.e. File Name, Date Created, City, Country, Document, Title, etc.) into an external database from the Adobe Bridge. Ideally it would be compatible to .txt, .csv, etc type of database format. Currently I have to accomplish this task one at a time. I have an immediate need to upload 1000 plus pictures and various text fields into my website to share with others and be able to sell my pictures online.

My immediate is for exporting the metadata and keywords.

Does anyone know of a script that is aavailable?

Arnold
 
Replies 1 2 Previous Next
  • Currently Being Moderated
    Aug 2, 2005 10:44 AM   in reply to (Arnold_Dubin)
    #target bridge

    if (BridgeTalk.appName == "bridge")
    {
    // Let's create our menu
    var menu = MenuElement.create( "command", "Export File List to Spreadsheet", "at the end of Tools");
    menu.onSelect = function(m) {
    try
    {
    // Let's ask what the name of the output file
    var f = File.saveDialog("Export file list to:", "Comma delimited file:*.CSV");

    // Write the column headings
    f.open("w");
    f.writeln("#,name,path,Author, Country, Location, CountryCode, Lens");

    // Let's get a list of all the visible thumbnails
    var items = app.document.visibleThumbnails;

    for (var i = 0; i < items.length; ++i) { var item = items[i]; f.writeln(i + 1, ",\"", item.name, "\",\"", item.path.replace(/\"/g, "\"\""), "\",\"", ListMetadata(item), "\",\"", "\"" ); } f.close(); } catch(e) { } } menu.onDisplay = function(m) { m.enabled = app.document.contentPaneMode == "filesystem" && app.document.visibleThumbnails.length > 0;
    }
    }

    function ListMetadata(tn)
    {
    md = tn.metadata;
    md.namespace = "http://ns.adobe.com/photoshop/1.0/";
    varAuthor = md.Author + "\",\"" + md.Country + "\",\"";

    md.namespace = "http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/" ;
    varLocation = md.Location + "\",\"" + md.CountryCode + "\",\"" ;

    md.namespace = "http://ns.adobe.com/exif/1.0/aux/";
    varLens = md.Lens ;

    return varAuthor + varLocation + varLens ;

    }
     
    |
    Mark as:
  • Currently Being Moderated
    Aug 3, 2005 12:56 PM   in reply to (Arnold_Dubin)
    Glad it helped Arnold - I hoped posting it "as is" would help you.

    John
     
    |
    Mark as:
  • Currently Being Moderated
    Aug 4, 2005 9:51 PM   in reply to (Arnold_Dubin)
    Thanks for posting it Arnold. The keywords will be awkward, as they're going to be a multivalue field. So you'll need to calculate their "length" (count) and use that in a for loop like in the ListMetadata function, converting it into a comma separated string. I'd probably do it as a separate function, called from a line in ListMetadata. Depending on what you ultimately want to do, it may even be easier to export the filename and keywords as a separate file so it can be imported as another table into Access.

    Isn't Flash under the exif properties? You may be able to get at it by setting the namespace to http://ns.adobe.com/exif/1.0/Flash/ and then looking for Fired.
     
    |
    Mark as:
  • Currently Being Moderated
    Aug 5, 2005 1:21 AM   in reply to (Arnold_Dubin)
    From my original ListMetadata function:
    md.namespace = "http://ns.adobe.com/photoshop/1.0/";
    varKeywords = ListKeywords(md) + "\",\"" ;

    A new function:

    function ListKeywords(md)
    {
    var varKeywords = "" ;
    for (var i = 0; i < md.Keywords.length; ++i)
    {
    varKeywords = varKeywords + md.Keywords[i] + ", ";
    }
    //strip off final comma and space
    varKeywords = varKeywords.substring( 0, varKeywords.length-2);

    return varKeywords ;
    }
     
    |
    Mark as:
  • Currently Being Moderated
    Aug 6, 2005 10:36 PM   in reply to (Arnold_Dubin)
    You see to have placed the keywords function inside the existing function. Not sure if this is right - I put it outside.
     
    |
    Mark as:
  • Currently Being Moderated
    Aug 7, 2005 11:00 AM   in reply to (Arnold_Dubin)
    In ListMetadata, you dropped out the reference to ListKeywords. I just ran this and exported keywords as expected.

    #target bridge

    if (BridgeTalk.appName == "bridge")
    {
    // Let's create our menu
    var menu = MenuElement.create( "command", "Export CSV File", "at the end of Tools");
    menu.onSelect = function(m) {
    try
    {
    // Let's ask what the name of the output file
    var f = File.saveDialog("Export file list to:", "Comma delimited file:*.CSV");

    // Write the column headings
    f.open("w");
    f.writeln("Seq Number,New File Name,New File Name Path,Original File Name,Org Dt & Tm,ISO,Exposure Time,F Stop,EV,Exposure Program,Meter Mode,Focal Length,Flash,Lens,Author, Author's Position,City,Country,Description,Title,Orientation,Width,Height,Rati ng,Label,KeyWords");

    // Let's get a list of all the visible thumbnails
    var items = app.document.visibleThumbnails;

    for (var i = 0; i < items.length; ++i) { var item = items[i]; f.writeln(i + 1, ",\"", item.name, "\",\"", item.path.replace(/\"/g, "\"\""), "\",\"", ListMetadata(item), "\",\"", "\"" ); } f.close(); } catch(e) { } } menu.onDisplay = function(m) { m.enabled = app.document.contentPaneMode == "filesystem" && app.document.visibleThumbnails.length > 0;
    }
    }

    function ListMetadata(tn)
    {
    md = tn.metadata;
    md.namespace = "http://ns.adobe.com/photoshop/1.0/";
    varAuthor = md.Author + "\",\"" + md.AuthorsPosition + "\",\"" + md.City + "\",\"" + md.Country + "\",\"";
    varKeywords = ListKeywords(md);

    md.namespace = "http://ns.adobe.com/exif/1.0/aux/";
    varLens = md.Lens + "\",\"" ;

    md.namespace = "http://purl.org/dc/elements/1.1/";
    vartitle = md.title + "\",\"" + md.description + "\",\"" ;

    md.namespace = "http://ns.adobe.com/xap/1.0/mm/"
    VarPreservedFileName = md.PreservedFileName + "\",\"" ;

    md.namespace = "http://ns.adobe.com/exif/1.0/"
    VarDateTimeOriginal = md.DateTimeOriginal + "\",\"" + md.ISOSpeedRatings + "\",\"" + md.ExposureTime + "\",\"" + md.FNumber + "\",\"" + md.ExposureBiasValue + "\",\"" + md.ExposureProgram + "\",\"" + md.MeteringMode + "\",\"" + md.FocalLengthIn35mmFilm + "\",\"" + md.Flash + "\",\"" ;

    md.namespace = "http://ns.adobe.com/tiff/1.0/"
    varOrientation = md.Orientation + "\",\"" + md.ImageWidth + "\",\"" + md.ImageLength + "\",\"" ;

    md.namespace = "http://ns.adobe.com/xap/1.0/"
    varRating = md.Rating + "\",\"" + md.Label ;

    return VarPreservedFileName + VarDateTimeOriginal + varLens + varAuthor + vartitle + varOrientation + varRating + varKeywords;

    }

    function ListKeywords(md)
    {

    var varKeywords = "" ;
    for (var i = 0; i < md.Keywords.length; ++i) { varKeywords = varKeywords + md.Keywords[i] + ", "; } //strip off final comma and space varKeywords = varKeywords.substring( 0, varKeywords.length-2);

    md.namespace = "http://ns.adobe.com/photoshop/1.0/";
    varKeywords = ListKeywords(md) + "\",\"" ;

    return varKeywords ;
    }
     
    |
    Mark as:
  • Currently Being Moderated
    Aug 8, 2005 5:49 AM   in reply to (Arnold_Dubin)
    There were a couple of errors in the script.

    Bob
    Adobe WAS Scripting

    Try this, save it to your startup scripts folder:

    #target bridge

    if (BridgeTalk.appName == "bridge" ) {

    // Let's create our menu
    var menu = MenuElement.create( "command", "Export CSV File", "at the end of Tools");
    menu.onSelect = function(m) {
    try {
    // Let's ask what the name of the output file
    var f = File.saveDialog("Export file list to:", "Comma delimited file:*.CSV");

    if ( !f ) { return; }

    // Write the column headings
    f.open("w");
    f.writeln("Seq Number,New File Name,New File Name Path,Original File Name,Org Dt & Tm,ISO,Exposure Time,F Stop,EV,Exposure Program,Meter Mode,Focal Length,Flash,Lens,Author, Author's Position,City,Country,Description,Title,Orientation,Width,Height,Rati ng,Label,KeyWords");


    // Let's get a list of all the visible thumbnails
    var items = app.document.visibleThumbnails;

    for (var i = 0; i < items.length; ++i) {
    var item = items[i];
    f.writeln(i + 1, ",\"", item.name, "\",\"", item.path.replace(/\"/g, "\"\""), "\",\"", ListMetadata(item), "\",\"", "\"" );
    }

    f.close();
    } catch(e) {
    }
    }
    }

    function ListMetadata(tn) {

    md = tn.metadata;
    md.namespace = "http://ns.adobe.com/photoshop/1.0/";
    var varAuthor = md.Author + "\",\"" + md.AuthorsPosition + "\",\"" + md.City + "\",\"" + md.Country + "\",\"";

    var varKeywords = ListKeywords(md);

    md.namespace = "http://ns.adobe.com/exif/1.0/aux/";
    var varLens = md.Lens + "\",\"" ;

    md.namespace = "http://purl.org/dc/elements/1.1/";
    var vartitle = md.title + "\",\"" + md.description + "\",\"" ;

    md.namespace = "http://ns.adobe.com/xap/1.0/mm/"
    var VarPreservedFileName = md.PreservedFileName + "\",\"" ;

    md.namespace = "http://ns.adobe.com/exif/1.0/"
    var VarDateTimeOriginal = md.DateTimeOriginal + "\",\"" + md.ISOSpeedRatings + "\",\"" + md.ExposureTime + "\",\"" + md.FNumber + "\",\"" +
    md.ExposureBiasValue + "\",\"" + md.ExposureProgram + "\",\"" + md.MeteringMode
    + "\",\"" + md.FocalLengthIn35mmFilm + "\",\"" + md.Flash + "\",\"" ;

    md.namespace = "http://ns.adobe.com/tiff/1.0/"
    var varOrientation = md.Orientation + "\",\"" + md.ImageWidth + "\",\"" +
    md.ImageLength + "\",\"" ;

    md.namespace = "http://ns.adobe.com/xap/1.0/"
    var varRating = md.Rating + "\",\"" + md.Label + "\",\"";

    return VarPreservedFileName + VarDateTimeOriginal + varLens + varAuthor + vartitle + varOrientation + varRating + varKeywords;

    }

    function ListKeywords(md) {
    md.namespace = "http://ns.adobe.com/photoshop/1.0/";
    var Keywords = md.Keywords;

    var varKeywords = "" ;
    for ( var i = 0; i < Keywords.length; ++i ) {
    varKeywords = varKeywords + Keywords[i] + ", ";
    }
    //strip off final comma and space varKeywords =
    varKeywords.substring( 0, varKeywords.length-2);

    return varKeywords ;
    }
     
    |
    Mark as:
  • Currently Being Moderated
    Sep 19, 2005 2:13 PM   in reply to (Arnold_Dubin)
    Super stuff Bob :)
    heathrowe
     
    |
    Mark as:
  • Currently Being Moderated
    Nov 24, 2005 10:44 AM   in reply to (Arnold_Dubin)
    If I may kindly piggyback on all the work Bob & Arnold have done: I too have been looking for a way to be able to provide clients with the medadata for images from their shoot, and the script that you have just made looks like IT. I have never worked with scripts, and it would help me if you could post three things for me (or is there an easier way to get it to me?)
    1: the final, corrected script you have worked out, and
    2: where to go for an informative guide about scripts that will tell me, from the begining, how to make one, install this one, and troubleshoot them.
    3. How I can download all 14 of your postings in one file, so I can try to trace your prosess? (Seems like this is a good tool for the next Bridge revision.)
     
    |
    Mark as:
  • Currently Being Moderated
    Nov 25, 2005 8:32 AM   in reply to (Arnold_Dubin)
    Chris,

    Barredrock software (www.barredrocksoftware.com) has a script for sale that is a generalized metadata exporter. It will do what you need in a more general case.

    I don't know what they charge for it, but I don't think anything on their site is more that $15.

    The only definitive guide is the bridge scripting guide that is on your CD, and download-able from Adobe Exchange. You can also purchase a hardcopy from Adobe Press.

    At the bottom of the forum message display you'll see "Show All Messages" on the right side of the same bar that contains the "First, Previous, Next, Last" options.

    Bob
    Adobe Workflow Scripting
     
    |
    Mark as:
  • Currently Being Moderated
    Nov 25, 2005 4:32 PM   in reply to (Arnold_Dubin)
    Thanks Bob. Barredrock seems like just the ticket for my needs. That Scripting Guide is a little intimitating. ( I avoided having to learn dos by going Mac; avoided having to learn html with Dreamweaver; now will I have to confront scripting...?)
     
    |
    Mark as:
  • Currently Being Moderated
    Nov 26, 2005 7:51 AM   in reply to (Arnold_Dubin)
    Chris,

    Should you learn scripting? Well, it kinda depends on what you do and what you need. There are folks out there who will write scripts for you, some for free, some for money, but if you really need something now and it doesn't exist, knowing how to script could be invaluable to you. If the script wasn't available from Barred Rock, you'd be looking at having weeks of monkey-level work. (weeks because you'd drive yourself crazy if you tried to do it one sitting). To you, Barredrock's script is worth a lot.

    To me (and I am very biased here), the most important features of CS2 and the CS2 products are Bridge and the new scripting feature set. Here's why...

    Bridge is virtually completely scriptable. While there are a couple of exceptions, just about anything you might want to do is possible via the scripting interface. The more I get to know the folks who implemented these features, the more impressed I am with the depth of their original vision.

    One of the features, BridgeTalk, allows scripts of arbitrary complexity to be executed on other Adobe products. Stated another way, you can write a script that will be executed from Bridge that will be sent from bridge to Photoshop (or InDesign, GoLive, Illustrator). That script will be executed in the target environment, and any results returned back to Bridge. You can also go from the point products to each other.

    If you combine the two concepts, you have an environment that allows you to do almost anything. You can add features to Bridge via scripting, and anything you might need from any of the Adobe products is available to you. That is a fantastic concept. From a product line capability standpoint, Bridge is nothing less than sheer brilliance because it provides the hub necessary to do almost anything.

    Think of anything you might have to do repetetively on a set of files. Go to photoshop to standardize image, size, resolution, color mode, etc. Take the new images and put them in a contact sheet in ID, or generate some HTML for a web gallery, or...

    Adobe Stock Photos is a script. You're working in InDesign, and need a stock photo - you flip to Bridge, search, purchase, and place. It can't get much easier than that.

    Since Bridge is in it's first incarnation, and it's early in the 1.0 product cycle, we're only now starting to see scripts for Bridge come available. As time progresses, the number of scripts available will only grow. I see the day coming when folks will be selecting from a mountain of scripts to make Bridge do exactly what they need in their daily work. Each user's Bridge installation will be uniquely tailored to their needs. This capability is only possible by scripting.

    The example scripts we wrote (Contact Sheet for ID, Export to Flash, Import from Camera) were really just example scripts to show how automation features could be added to Bridge. Eventually (and experience tells us it will happen), people will take these examples and build some wonderful new widgets. It just takes time to get the ball rolling.

    Should you take the time and effort to learn it? It depends on you and your needs. I can guarantee you that it will be time well-spent and you will not regret it. I would suggest purchasing a JavaScript book first. Once you understand the language, the scripting guide won't seem so formidable.

    Bob
    Adobe Workflow Scripting
     
    |
    Mark as:
  • Currently Being Moderated
    Apr 24, 2006 12:42 PM   in reply to (Arnold_Dubin)
    John, Bob,

    wow, I just got hot all over reading this thread. Arnold, thank you for starting it! I can't believe it, it is exactly the type of thing that I was looking for. It worked perfectly and sucked right up into my mySQL DB where I can also output it as XML. LOVELY!

    I look forward to breaking the code apart a bit to see what you did and how you did it. I will look through the bridge scripting reference guide to figure out how to get it to work ONLY on images that are selected. I get really nervous looking at lines like: md.namespace = "http://ns.adobe.com/xap/1.0/mm/" which make me feel like we're somehow/for some reason pointing to a URL that may be broken in the future, but what do I know?

    Thanks guys for such great work! Shoot, now another thing to learn!

    -Alastair
     
    |
    Mark as:
  • Currently Being Moderated
    Apr 25, 2006 6:24 AM   in reply to (iPhotoStuff)
    Alastair_Halliday@adobeforums.com wrote:
    >
    > I get really nervous looking at lines like: md.namespace = "http://ns.adobe.com/xap/1.0/mm/" which make me feel like we're somehow/for some reason pointing to a URL that may be broken in the future, but what do I know?
    >
    Don't worry. It's the URL that's important, not the content that may or may not
    be at that URL.

    -X
     
    |
    Mark as:
  • Currently Being Moderated
    Apr 27, 2006 7:16 AM   in reply to (Arnold_Dubin)
    thanks X. Hey, so where can I find a list of the variables that I can get access to? I know that The guys above have listed them in the code, but I want some documentation. Any idea?

    -a
     
    |
    Mark as:
  • Currently Being Moderated
    Jan 12, 2007 7:38 AM   in reply to (Arnold_Dubin)
    I am having trouble locating the extension on the site you had mentioned, about exporting metadata from Adobe Bridge to another application. If you have any further more discript detail to pick up the code, it would be extremely helpful!!
     
    |
    Mark as:
  • Currently Being Moderated
    Jan 12, 2007 7:46 AM   in reply to (Arnold_Dubin)
    I have a script to export metadata from Bridge to CSV.

    email me off-line

    rstucky@starband.net

    Regards

    Bob
     
    |
    Mark as:
  • Currently Being Moderated
    Mar 22, 2007 2:49 PM   in reply to (Arnold_Dubin)
    Hi,
    I was looking for some sort of metadata export thing and just read through this thread and tried out the script and it works great. I was just wondering though, is there anyway to make this work kinda like the InDesign Contactsheet script (IE, write to an indesign file) and maybe a pop up box to select which metatdata information to write? ?

    what I was really looking for is a contact sheet with the meetadata , so i get a little thumbnail too. but i really can't find anything out there that does this.
     
    |
    Mark as:
  • Currently Being Moderated
    Mar 29, 2007 5:18 PM   in reply to (Arnold_Dubin)
    yes.. me to???

    Is there a way of creating contact sheets that show the keywords etc???

    I am in the process of designing an image library & I need to show certain clients their images with keywords so that they can approve them??? help!!

    amy..
     
    |
    Mark as:
  • Currently Being Moderated
    Mar 30, 2007 5:50 AM   in reply to (Amy_Kane)
    Amy_Kane@adobeforums.com wrote:
    >
    > Is there a way of creating contact sheets that show the keywords etc???
    >
    > I am in the process of designing an image library & I need to show certain clients their images with keywords so that they can approve them??? help!!

    I can get you a tweaked version of CSX if that would help.
    http://ps-scripts.sourceforge.net/ContactSheetX/csx.html

    I'm not planning on offering full metadata caption support for a couple of
    months but I can handle just keywords fairly easily.

    -X

    --
    for photoshop scripting solutions of all sorts
    contact: xbytor@gmail.com
     
    |
    Mark as:
  • Currently Being Moderated
    May 30, 2007 8:28 AM   in reply to (Arnold_Dubin)
    Hi,

    I installed the script to Bridge and it even lists it under the "manage scripts" dialogue box... unfortunately, when I export the contact sheet by going to tools>indesign>contact sheet, all it exports is the same information it exported before - not the metadata.

    Can anyone walk me through this?

    Thanks!
     
    |
    Mark as:
  • Currently Being Moderated
    May 30, 2007 3:17 PM   in reply to (Arnold_Dubin)
    I dont think that I ever got this to work either???

    sorry!

    but if anyone helps you... id like to know also!
     
    |
    Mark as:
  • Currently Being Moderated
    Sep 21, 2007 10:45 PM   in reply to (Arnold_Dubin)
    Read through this thread and found lots of helpful info. I'm having a problem with script that reads metadata correctly in Bridge CS2 but fails to retrieve the variables under:

    ps1.namespace = "http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/"

    when trying to run it under Bridge CS3. I found the same issues trying the iterations in this thread. What am I doing wrong?

    Here's my script:

    //------------------------------------------------------------------
    RunScript4.run = function( )
    {
    var thumbs = getBridgeThumbnails ( TYPES.PHOTOSHOP_OPENABLE, false, true);
    try
    {
    var f = File.saveDialog("Enter Filename for Export:", "Double delimited file:*.txt");
    if(!f)
    {
    Window.alert ("Export Metadata:" + "\n" + "No filename entered.");
    }
    else
    {
    f.open("w");
    // Create header line
    var headerLine = f.write ( "~Filename~,~Title~,~Author~,~Copyright~,~Address~,~City~,~State~,~Zi p~,~Phone~,~Email~,~Website~" + "\n") ;
    // Loop through selected thumbnails
    for ( var i = 0; i < thumbs.length; i++)
    {
    thumb = thumbs[i];
    ps1 = thumb.metadata;
    // write metadata to file
    var imageData = f.write ("~" +thumb.name + "~,", metaData(thumb),"\n");
    }
    f.close();
    //
    if (i == 1)
    Window.alert ("There was " + i + " record exported to " + f + ". ");
    else
    Window.alert ("There were " + i + " records exported to " + f + ". ");
    }// end filename else
    }// end try
    catch(e)
    {
    // Errors handled here
    }
    }// end function

    function metaData()
    {
    ps1.namespace = "http://ns.adobe.com/photoshop/1.0/";
    fileInfo = "~" + ps1.AuthorsPosition + "~,~" + ps1.Author + "~,~" + ps1.Copyright + "~,~";

    ps1.namespace = "http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/";
    fileInfo = fileInfo + ps1.CiAdrExtadr + "~,~" + ps1.CiAdrCity + "~,~" + ps1.CiAdrRegion + "~,~" + ps1.CiAdrPcode + "~,~" + ps1.CiTelWork + "~,~" + ps1.CiEmailWork + "~,~" + ps1.CiUrlWork + "~";

    return fileInfo;
    }
    //-------------------------------------------------------------------
     
    |
    Mark as:
  • Currently Being Moderated
    Sep 22, 2007 8:33 AM   in reply to (Arnold_Dubin)
    There is a pretty good export metadata script up on my website.

    www.creativescripting.net

    Look for the barred rock scripts. It's in that set.

    Regards

    Bob
    www.creativescripting.net
    for all your Bridge and InDesign scripting needs
     
    |
    Mark as:
  • Currently Being Moderated
    Oct 28, 2007 3:28 PM   in reply to (Arnold_Dubin)
    Bob,

    Thanks for the response these seem to be a great utilities. However, the script that you directed me to does not allow me to retrieve data from the specific entries I need as listed above. i.e. "http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/" - address, city, state, zip, phone, email and website.

    The script I have works fine in CS2. I would like to migrate completely to CS3, but I can't get this script to work. Hopefully someone knows a solution.

    Paul
     
    |
    Mark as:
  • Currently Being Moderated
    Oct 28, 2007 4:35 PM   in reply to (Arnold_Dubin)
    i have been over seas for a while... I have come back & installed the script and its working!!!

    just wanted to say Thanks!!!

    I am in the middle of creating a Image Library for our company and we are developing it with Index Server and I need to supply lists of the keywords used & this script is great as it gives me a file with all the keywords in one document...

    thanks again!
     
    |
    Mark as:
  • Currently Being Moderated
    Oct 28, 2007 9:28 PM   in reply to (Arnold_Dubin)
    I will have a look at it; however, at this time I am horribly buried in work. I'll get to it as quickly as I can.

    Bob
     
    |
    Mark as:
  • Currently Being Moderated
    Jan 28, 2008 3:54 PM   in reply to (Arnold_Dubin)
    Not sure how active this forum is, but will try anyway. I am looking for a script to insert in an action to add Filename in Metadata through Bridge. I am a Photographer and work w/ LR V1.3.1.
    The LR works fine, but when exporting images, the app will not tick the Copyright Status Switch or the Copyright information.

    I have written actions to overcome this, but still have to add Document Name to each file.

    Is there a better way?

    Thanks,
    Alex@bachnickphoto.com
     
    |
    Mark as:
  • Currently Being Moderated
    Apr 5, 2008 6:57 AM   in reply to (Arnold_Dubin)
    Hi folks,

    This is really Great work!!! Thanks so much.

    2 questions:
    1.Is is possible to export directly to an access database table?
    2.I am using CS3 but can only get the info for 3 images to show up any idea why.

    By the way for any newbies like me you have to copy the code you see in the posting into notepad or Adobe ExtenScript Toolkit2 and save the file as a .jsx file.

    Then in Bridge select edit/preferences/startup scripts and click the button "Reveal" to see where you scripts folder is on your system. Then you just save your file to that folder. Shut down Bridge reopen it and you will be asked if you would like to install the script. Once it's installed you will see it listed at the bottom of the tools drop down.

    Here is my code:

    #target bridge

    if (BridgeTalk.appName == "bridge")
    {
    // Let's create our menu
    var menu = MenuElement.create( "command", "Export File List to Excel", "at the end of Tools");
    menu.onSelect = function(m) {
    try
    {
    // Let's ask what the name of the output file
    var f = File.saveDialog("Export file list to:", "Microsoft Office Excel Workbook:*.XLS");

    // Write the column headings
    f.open("w");
    f.writeln("#,Image_Name,Copyright,");

    // Let's get a list of all the visible thumbnails
    var items = app.document.visibleThumbnails;

    for (var i = 0; i < items.length; ++i) { var item = items[i]; f.writeln(i + 1, ",\"", item.name, "\",\"", ListMetadata(item), "\",\"", "\"" ); } f.close(); } catch(e) { } } menu.onDisplay = function(m) { m.enabled = app.document.contentPaneMode == "filesystem" && app.document.visibleThumbnails.length > 0;
    }
    }

    function ListMetadata(tn)
    {
    md = tn.metadata;
    md.namespace = "http://ns.adobe.com/photoshop/1.0/";
    varCopyright = md.Copyright + "\",\"" ;

    return varCopyright;

    }

    Many Thanks
    Sylvia
     
    |
    Mark as:
  • Currently Being Moderated
    Apr 6, 2008 11:39 AM   in reply to (Arnold_Dubin)
    Paul, is this something like?

    #target bridge
    if (BridgeTalk.appName == "bridge" ) {
    var menu = MenuElement.create( "command", "Export Info to Text File", "at the end of Tools");
    menu.onSelect = function(m) {
    try {
    var f = File.saveDialog("Export file list to:", "Text file:*.TXT");
    if ( !f ) { return; }
    f.open("w");
    f.writeln( "~Filename~,~Title~,~Author~,~Copyright~,~Address~,~City~,~State~,~Zi p~,~Phone~,~Email~,~Website~" + "\n");
    var items = app.document.selections;
    for (var i = 0; i < items.length; ++i) {
    var item = items[i];
    f.writeln(item.name,',',ListMetadata(item) );
    };
    f.close();
    } catch(e) {}
    };
    };

    function ListMetadata(tn) {
    md = tn.metadata;
    md.namespace = "http://ns.adobe.com/photoshop/1.0/";
    var fileInfo = "~" + md.AuthorsPosition + "~,~" + md.Author + "~,~" + md.Copyright + "~,~";
    md.namespace = "http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/";
    var myCity = md.read("http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/", "Iptc4xmpCore:CreatorContactInfo/Iptc4xmpCore:CiAdrCity");
    var myRegion = md.read("http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/", "Iptc4xmpCore:CreatorContactInfo/Iptc4xmpCore:CiAdrRegion");
    var myPostCode = md.read("http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/", "Iptc4xmpCore:CreatorContactInfo/Iptc4xmpCore:CiAdrPcode");
    var myCountry = md.read("http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/", "Iptc4xmpCore:CreatorContactInfo/Iptc4xmpCore:CiAdrCtry");
    var myTel = md.read("http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/", "Iptc4xmpCore:CreatorContactInfo/Iptc4xmpCore:CiTelWork");
    myTel = myTel.replace(/\n/g, ' ');
    var myEmail = md.read("http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/", "Iptc4xmpCore:CreatorContactInfo/Iptc4xmpCore:CiEmailWork");
    var myURL = md.read("http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/", "Iptc4xmpCore:CreatorContactInfo/Iptc4xmpCore:CiUrlWork");
    var myAddress = md.read("http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/", "Iptc4xmpCore:CreatorContactInfo/Iptc4xmpCore:CiAdrExtadr");
    myAddress = myAddress.replace(/\n/g, ' ');
    fileInfo += myAddress + "~,~" + myCountry + "~,~" + myRegion + "~,~" + myPostCode + "~,~" + myTel + "~,~" + myEmail + "~,~" + myURL + "~";
    return fileInfo;
    };
     
    |
    Mark as:
  • Currently Being Moderated
    Apr 7, 2008 10:27 AM   in reply to (Arnold_Dubin)
    Sylvia:-
    It may be possible to export to workbook, but it would have to be done with VB.
    Your second question, it might be that the fourth file is NOT a valid photoshop file. It might be better to change the code to selections and see if that works.

    Paul.
     
    |
    Mark as:
  • Currently Being Moderated
    Oct 7, 2008 8:24 PM   in reply to (Arnold_Dubin)
    Paul R.,

    Sorry I haven't been back to look at your response and help before today. This appears to be "right on" getting the information I need. I'm relatively new to scripting Bridge so I'll see if I can learn from your example and apply it to the script I have been using in CS2. Hopefully there won't be any script surprises in CS4.

    Thanks again...
    paulshoe
     
    |
    Mark as:
  • Currently Being Moderated
    Nov 30, 2008 12:03 PM   in reply to (Arnold_Dubin)
    Thanks for answer

    Good Luck.
    ______
    My Si tes
     
    |
    Mark as:
1 2 Previous Next

More Like This

  • Retrieving data ...

Bookmarked By (0)