That is quite curious.
You should not be calling the File() constructor on the return of File.saveDialog() though -- the latter returns a file already. Do you see a change if you simply call app.libraries.add((myFile);?
No John, I tried to call the direct way app.libraries.add((myFile); but received the same message again.
1 person found this helpful
MacOS Classic had a very different way from what is in fashion with nowaday's OSX to specify files and paths. Under the hood InDesign still uses a mixture of the old "Carbon" and the new approach (via ways too many competing wrapper code libraries), and conversions in between. Therefor you'll still occasionally find paths with ":" colon as separator (e.g. in error messages), but more increasingly with the Unix "/" notation.
The effect you're seeing is when in the process of conversion an intermediate string is parsed and the code can't decide whether it is a relative file path in the one notation or the other. In that case the current working directory comes into play, which frequently happens to be the last accessed startup script folder. See yourself in Extendscript console: Folder.current.name => "XHTML For Digital Editions"
Similarly ugly effects are XSLs not being recognized from XML import preferences, or files being created in the mid of the InDesign application bundle.
Short from filing a bug at Adobe (please do that anyway) I don't have a solution at hand, but I'd try to fool the system and set the current directory to the parent or grand parent folder of myFile before creating the library, or pass myFile in different string forms (absolute or relative path) and so forth. Please tell us if you achieved anything that way.
Could you not just replace 'displayedName' with 'name'?
1. Why displayName works with CS4 (both Windows and Mac).
2. Why displayName works with CS5 on Windows?
I can't figure that out.
Thanks for your answer Mark. It was right.
I tested with displayedName and got the same results as you and others… localizedName returned undefined… just using name worked but Im not too sure what localizing is used for… at least you have it working…