Question
metadata scripting problems
I have been working with metadata scripting for a while and I have noticed several things that don't work as I expect. Anyone know what I might be doing wrong or know whether this is just the way things work?
1. It seems that the metadata object does not support reflection, md.reflect.properies returns an invalid object.
2. Camera Raw settings can not be read, for example alert(md.Tint) shows nothing.
3. The metadata panels continue to show the old data after my script changes them. File Info... shows the changed data. Is there a way to force the panel to update?
Here is a simple script to show what I mean (1 and 2):
newMenu = new MenuElement("menu", "Meta", "after Help", "mySimpleMenu" );
theMenuItem = new MenuElement("command", "test", "at the end of mySimpleMenu", "mySimpleItem");
theMenuItem.onSelect = function()
{
md = app.document.thumbnail.metadata;
md.namespace = "http://ns.adobe.com/camera-raw-settings/1.0/";
alert("Tint = " + md.Tint);
alert("RawFileName = " + md.RawFileName);
alert("name = " + md.reflect.name);
props = md.reflect.properties;
try
{
count = props.length;
}
catch (error)
{
alert("Error: \"" + error + "\"");
}
var string = "";
for (i = 0; i < props.length; i++)
string += (props + "\n");
string += "\n";
alert(string);
}
1. It seems that the metadata object does not support reflection, md.reflect.properies returns an invalid object.
2. Camera Raw settings can not be read, for example alert(md.Tint) shows nothing.
3. The metadata panels continue to show the old data after my script changes them. File Info... shows the changed data. Is there a way to force the panel to update?
Here is a simple script to show what I mean (1 and 2):
newMenu = new MenuElement("menu", "Meta", "after Help", "mySimpleMenu" );
theMenuItem = new MenuElement("command", "test", "at the end of mySimpleMenu", "mySimpleItem");
theMenuItem.onSelect = function()
{
md = app.document.thumbnail.metadata;
md.namespace = "http://ns.adobe.com/camera-raw-settings/1.0/";
alert("Tint = " + md.Tint);
alert("RawFileName = " + md.RawFileName);
alert("name = " + md.reflect.name);
props = md.reflect.properties;
try
{
count = props.length;
}
catch (error)
{
alert("Error: \"" + error + "\"");
}
var string = "";
for (i = 0; i < props.length; i++)
string += (props + "\n");
string += "\n";
alert(string);
}
