Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Display hide metadata

New Here ,
Aug 16, 2006 Aug 16, 2006
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
TOPICS
Scripting
642
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 16, 2006 Aug 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 16, 2006 Aug 16, 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 20, 2006 Aug 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Aug 20, 2006 Aug 20, 2006
LATEST
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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines