4
$\begingroup$

How to "save as" a notebook programmatically (from within the notebook), given a path string?

here is a path string (it specifies the new name and location of the new notebook)

path="/home/conor/myNewNoteBook.nb"

I have tried many commands but none seem to work. I reckon it is something similar to this.

FrontEndExecute[
    FrontEndToken[FrontEnd`InputNotebook[], {path, "Notebook"}]
 ]

Unfortunately this similar question's solution doesn't work for me. (Maybe its because I'm using linux?)

$\endgroup$
  • 2
    $\begingroup$ Unless you just want to save the notebook to a different location, in which case NotebookSave is your function. $\endgroup$ – b3m2a1 Jul 16 '18 at 17:54
4
$\begingroup$

Expanding b3m2a1's comment...

path = "/home/conor/myNewNoteBook.nb";
NotebookSave[EvaluationNotebook[], path]

this can be made into a function, which can be auto loaded on start up, saving the user from having to use the mouse.

$\endgroup$
  • 1
    $\begingroup$ If this is what you need I see no reason not to accept it so the question can be tagged as satisfactorily answered $\endgroup$ – b3m2a1 Jul 16 '18 at 18:17
  • $\begingroup$ Thanks, (it won't let me tag it for 2 days). I'll tag it in 2 days time. $\endgroup$ – Conor Cosnett Jul 16 '18 at 18:23

Not the answer you're looking for? Browse other questions tagged or ask your own question.