Skip to main content
Participating Frequently
August 2, 2005
Question

Script to Export and Import Keywords and Metadata

  • August 2, 2005
  • 37 replies
  • 10452 views
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
This topic has been closed for replies.

37 replies

Participant
September 22, 2007
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~,~Zip~,~Phone~,~Email~,~Website~" + "\n") ;
// Loop through selected thumbnails
for ( var i = 0; i < thumbs.length; i++)
{
thumb = thumbs;
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;
}
//-------------------------------------------------------------------
Participating Frequently
May 30, 2007
I dont think that I ever got this to work either???

sorry!

but if anyone helps you... id like to know also!
Participant
May 30, 2007
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!
Participating Frequently
March 30, 2007
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..
Known Participant
March 30, 2007
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
Participant
March 22, 2007
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.
January 12, 2007
I have a script to export metadata from Bridge to CSV.

email me off-line

rstucky@starband.net

Regards

Bob
Participant
January 12, 2007
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!!
Participant
April 27, 2006
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
Participant
April 24, 2006
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
Known Participant
April 25, 2006
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
Known Participant
November 26, 2005
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