1 person found this helpful
This always works for me:
workDoc.save(workDoc.fullName); workDoc.close (SaveOptions.NO);
Sadly, when I tried your suggestion in Extendscript Toolkit, execution stops at the saving line with the message "Unsaved documents have no full name." I guess this seems to suggest that it's actually opening a copy of the document in the beginning, so it naturally has no reference on where to save it until I give it one.
Thus, when I change your suggestion to read:
It appears to work fine. It just needed to be an absolute reference. (If that's the right term.) Thanks for your assistance, Peter Kahrel! Couldn't have done it without ya!
This is strange. workDoc.fullName is an object of type File. This script:
alert (app.documents.fullName + '\r' + app.documents.fullName.constructor.name)
prints something like
Would be interesting to see what the real full name is.
hm, yes, something is very odd here…
Maybe opening an InDesign file from a server volume means now something different compared to older versions?
Like opening a temp copy of a document?
Because InDesign CC 2017 now has a new feature when working with documents on a server and now is able to regain contact to a document on a server volume after the server was shut down and is available again after some time or if the working machine otherwise lost contact to the server and connects again after a while.
Peter Kahrel: Yeah that line doesn't work for me; I still get the same error message.
Laubender: My thoughts exactly. It must just be opening a copy of the original document. That would explain why it doesn't have a "full name" yet.
Also, 2 points that I neglected to bring up earlier:
- These files that are saved on the server and giving me grief were saved with an earlier version of InDesign. Perhaps CC 2015, 2014, or even the original CC. Some may go back as far as CS6, but I'm not sure if that's true.
- They were worked on and packaged locally, then copied to the server quite some time ago. When opening them, I get a warning message about 2 links being out of date and would I like to update them. I have newer versions of these files saved to my local HDD and, yes, some of the links have been changed in these new files. What's interesting is that the older files on the server have links that want to reference my local HDD. It sees those linked files (usually .icml files) on my HDD rather than the ones inside their own "/links" folder and sees they've changed; thus, the warning message to update links. However, if I open these same old server files from a different computer--one that does not have copies of them (newer or otherwise) on its local HDD--then the server files open up fine without any warning, and with all of their links referencing the proper ones in their respective "/links" folders. It's as though they are wired to look for some of their links on your local HDD first and, if it cannot find them, they have a fallback contingency to look in their own "/links" folder for those missing links.
Not sure if either of these has anything to do with the "opening a copy of a file" issue that I am apparently experiencing, but there you go.
- These files that are saved on the server and giving me grief were saved with an earlier version of InDesign.
That's the culprit.
You have to save them first to get a value for fullName.