This content has been marked as final. Show 4 replies
>file dont find on that path
Perhaps it's due to the difference between a File (which is an object) and your input (which is a text string). It has been mentioned somewhere before in this forum.
>app.books.save(File(myPath + Save + ".indb"), true);
A syntax error, or perhaps "doesn't support this method". app.books is an array; use mybook.save instead, which is equivalent to app.books[YourBookIndex].save.
Thank you for your reply.
var mybook = app.books.add(myPath + Save + ".indb");
mybook.save(File(myPath + Save + ".indb"), true);
As per your suggestion i change app.book.save to mybook.save but still it is giving me error and error is
"Invalid value for parameter 'versionComment'...'save'. Expected string, but recevied true"
Do you know is there any other way to load the file into the book or to load a complete folder into the book. If i have a folder where i can save all indesign file. I want to load all the files into the book. Is there any way to do this.
The error is because of
>void save ([to: File][, versionComments: string][, forceSave: bool=false])
Since you don't specify which arguments you set, it takes "versionComments" to be 'true', which causes the error.
>mybook.save(File(myPath + Save + ".indb"), "", true);
will do the trick. See the Scripting Help for more information on the arguments.
You didn't say if 'loading the file into the book' worked or not, but there is only one way to do so. I guess you have to do
>mybook.bookContents.add(File(myPath + Save + "-TOC.indd"));
there as well (with "File" added).
Thank you jongware.
Your trick works.