Save an open file to another folder
Hallo.
My intension is to open a document and save it at an other place (by choosing the path).
var myPath = new File (path);
var openFile = myPath.openDlg("Wähle die Datei aus");
var myNewBook = app.open(File(openFile));
var sv = File(myNewBook.name).saveDlg("Bitte Dokumentennamen eingeben.", ".indb");
if (sv != 0){
var doc = myNewBook.save(File(sv.path));
}
myNewBook.close(SaveOptions.YES);
This works until line 6. Then comes an error message like "you cannot save the dokument, it´s allready open".
A second question: where can I set a default saving-path (line 6)?
Greets!