Skip to main content
Participating Frequently
October 11, 2006
Question

Creating an image library & need a script written to allow the metadata to include the old file name

  • October 11, 2006
  • 6 replies
  • 584 views
Dear All,

I am in the process (start) of creating a massive image library... At the moment I am sorting images into the companies divisions and then assigning key words to the images & metadata to some (if known). What I need is a script that will write the old file name in the metadata because once I have the image library up and running all the images file names will be renamed to a sequential numbering system so if you wanted to find an image based on the old file name (say that Indesign or Quark is linked to) you will be able to locate this.

if anyone can help or even point me in the right direction, that woud be great ;p

amy kane.
This topic has been closed for replies.

6 replies

Participating Frequently
October 13, 2006
Thanks Nigel,

we really appreciate it... make sure you have a super duper weekend! & dont do anything too much over the weekend (I give you permission) haha

thanks Amy.
Participating Frequently
October 13, 2006
Hi Amy

I am glad this worked out! I am still quite new at this but have learned a lot from this forum and the forum at "ps-scripts.com". The Adobe documentation on Javascript is also quite thin on examples.

Regards, N
Participating Frequently
October 13, 2006
Nigel!

THANK YOU SO MUCH!!!!

I DID IT!.. you learn something everyday! I now now whats going on (well kind of)... thanks heaps...

We here in the office would like to thank you... HEAPS..

amy.
Participating Frequently
October 13, 2006
Thanks Nigel,

this sounds great, but I am not that familiar with scripts... I have heard that they can do stuff for you but I am not sure how to apply this... do I put this script in my scripts in my finder (in startup scrips)...

this is what I haev saved; (not sure if I have done it correctly)???

#target bridge

AddNametoMeta = {}; // function protoype

AddNametoMeta.execute = function(){
var sels = app.document.selections;
for (var i = 0; i < sels.length; i++){

var md = sels.synchronousMetadata;
md.namespace = "http://ns.adobe.com/photoshop/1.0/";
// create a custom tag e.g. "OldFileName"
// and copy the existing file name to this tag
md.OldFileName = sels.name;
}
}

// this script only works in bridge
if (BridgeTalk.appName == "bridge"){
if (MenuElement.find('scripts') == null){
var ScriptsMenu = new MenuElement( "menu", "Scripts", "after Help", "scripts");
}
var menu = new MenuElement("command", "Add Filename to Metadata", "at the end of scripts");
menu.onSelect = AddNametoMeta.execute;
}

// create a custom tag e.g. "OldFileName"
// and copy the existing file name to this tag
md.OldFileName = sels.name;

with ...

md.Title = sels.name;

- sorry to bother you, But I really appreicate your help...

thanks Amy,
Participating Frequently
October 12, 2006
Hi Amy

Rather than creating a custom tag (which will not be recognised by any other program), it is better to save the original filename to the "Title" tag.

With reference to my previous script, please replace the following:

// create a custom tag e.g. "OldFileName"
// and copy the existing file name to this tag
md.OldFileName = sels.name;

with ...

md.Title = sels.name;

The existing filename will then appear in the "Title" field of the metadata. You can then rename the images as required.

Regards, N
Participating Frequently
October 12, 2006
Hi Amy

I have not tested this completely so try out the following script on some test images to make sure that it does what you require.

#target bridge

AddNametoMeta = {}; // function protoype

AddNametoMeta.execute = function(){
var sels = app.document.selections;
for (var i = 0; i < sels.length; i++){

var md = sels.synchronousMetadata;
md.namespace = "http://ns.adobe.com/photoshop/1.0/";
// create a custom tag e.g. "OldFileName"
// and copy the existing file name to this tag
md.OldFileName = sels.name;
}
}

// this script only works in bridge
if (BridgeTalk.appName == "bridge"){
if (MenuElement.find('scripts') == null){
var ScriptsMenu = new MenuElement( "menu", "Scripts", "after Help", "scripts");
}
var menu = new MenuElement("command", "Add Filename to Metadata", "at the end of scripts");
menu.onSelect = AddNametoMeta.execute;
}

Regards, N