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

XMP Exception: LFA_Open: FSPathMakeRef failure

New Here ,
Jul 20, 2008 Jul 20, 2008
I get this error on the XMPFile call in the following script from ESTK2 on Mac OSX:

> #target bridge

>if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");

>var psdFile = new File("...picture.psd");

>if (psdFile.exists) {

>var xmpFile = new XMPFile(psdFile.fullName, XMPConst.FILE_PHOTOSHOP, XMPConst.OPEN_ONLY_XMP); // Blows up here

>var xmp = xmpFile.getXMP();

>}

"...picture.psd" is a Photoshop file that exists and has XMP data.

Any clues?
TOPICS
Scripting
1.6K
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 ,
Jul 21, 2008 Jul 21, 2008
Hmmm...

It seems that the File constructor replaces "/Users/username" at the beginning of paths with "~" and XMPFile does not like paths that begin with "~". Changing the XMPFile call seems to fix it:

> var xmpFile = new XMPFile(psdFile.fullName.replace("~", "/Users/username"), XMPConst.FILE_PHOTOSHOP, XMPConst.OPEN_ONLY_XMP);

... not nice!!!!
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 ,
Jul 22, 2008 Jul 22, 2008
In case anyone stumbles across this trying to solve the same problem:
>new XMPFile(psdFile.fullName.replace("~", $.getenv("HOME")),...

is better.
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
Adobe Employee ,
Jul 28, 2008 Jul 28, 2008
You might have better luck passing File.fsName instead of File.fullName.

-DAvid
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 ,
Jul 28, 2008 Jul 28, 2008
LATEST
Many thanks David

Don't know why but I had been trying "fsname" instead of "fsName" which didn't work of course so I ended up using "fullName".

Oh well! All's well that ends well!
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