Skip to main content
Participant
August 16, 2006
Question

Display hide metadata

  • August 16, 2006
  • 4 replies
  • 670 views
I've created a new xmp namespace with some metadata in it and I'd like to display only this meta on the main window with a script.
This can be done manually with "Edit" - "Preferences" - "Metadata"
There is also a Preferences object with an extraMetadata properties but I haven't find how to use it.
any idea?
Michel
This topic has been closed for replies.

4 replies

Inspiring
August 20, 2006
Nigel,

I also have a script that creates a custom namespace. I skip making a reference to the sels array item and use synchronousMetadata instead of just metadata.

md = sels.synchronousMetadata;
md.namespace = "http://ns.sem.com/semsa/1.0/";

The code then adds about 30 properties to the namespace.
Participating Frequently
August 20, 2006
Hi Michel

I have tried your sample code but it does not add any metadata to my image. I can add a new tag to an existing namespace without a problem. For example:

AddCustomMD = {};
AddCustomMD.execute = function() {
var sels = app.document.selections; // array of selected thumbs
for (var i = 0; i < sels.length; i++){
var thumb = app.document.selections;
if (thumb.spec instanceof File){
var md = thumb.metadata;

// this block works correctly
md.namespace = "http://ns.adobe.com/photoshop/1.0/";
md.Title = "TestTitle1";
md.Version = "Test Script 1";

// this block does not work.
md.namespace = "http://ns.test.com/customdata/1.0/";
md.Title = "TestTitle2";
md.Version = "Test Script 2";
}
}
}

I have linked the AddCustomMD function to a menu item in Bridge.

Any suggestions are welcome!

Regards, Nigel
_reynard_Author
Participant
August 17, 2006
Hi Nigel,

To have a new namespace you have to add some metadata in it
Here is a sample code

var tn = new Thumbnail(File(FilePath));
var md = tn.metadata;
md.namespace = "http://nb.myCompany.com/mySubject/1.0/"
md.myMeta1 = 3
md.name = "bla bla"

Here you have to new metadata (myMeta1 and name) in the new namespace
http://nb.myCompany.com/mySubject/1.0/

For some obscur raison in some case you have to create a md variable. In other case you can directly access with tn.metadata.namespace and so on

Regards, Michel
Participating Frequently
August 16, 2006
Hi Michel

Unfortunately I do not know the answer to your question, but I am interested in finding out how you managed to add a new xmp namespace. I tried to do this myself but I could not get it to work.

Regards, Nigel