Here's a nasty little bug.
var f = new File(Folder.desktop + '/test.psd');
var xf = new XMPFile(f.absoluteURI,
XMPConst.UNKNOWN,
XMPConst.OPEN_FOR_UPDATE);
This fails with a 'OpenFile returned false' message.
The XMPFile constructor does not take a File object as a first arg. Why? What
reason would it not take a proper File object like the rest of the JS APIs do?
And, apparently, code beneath the XMPFile constructor doesn't understand what
'~' means.
And there is no File/Folder API for determining what '~' is or completing
resolving the path. The absoluteURI property will _always_ substitute '~' for
the home directory if it's possible. So, it's not really absolute. This could be
classified as a bug, too.
The result is that I have to now manually check for a "~/" at the beginning of
every string that I pass to the XMPFile constructor and use $.getenv('HOME') to
determine what '~' is.
Or am I doing something wrong?
This fails identically in Bridge and PS CS4.
-X