This is probably fairly straightforward, but I wasn't able to find it right away. I'd like for Mathematica to display on startup the latest notebook I was working on, and nothing else. No additional old notebooks and no new blank notebook. There is probably an option hiding somewhere to do that, but I wasn't able to find it. Apologies if this is too simple.
2 Answers
R.M beat me but I'll post this anyway for variety.
You can open the last Notebook with:
Options[$FrontEnd, NotebooksMenu][[1, 2, -1, 2, 1]] // NotebookOpen
Methods for preventing the opening of a blank Notebook, for both version 7 and 8 are here:
The list of recently opened notebooks (as shown in File > Open Recent
) is saved in the NotebooksMenu
option for $FrontEnd
, arranged by ascending absolute time (i.e., most recent is last). So the most recent notebook can be opened with:
Last[NotebooksMenu /. Options@$FrontEnd] /.
HoldPattern[_ -> {file_, ___}] :> NotebookOpen@file
Some additional related questions that might of interest are:
-
$\begingroup$ Thanks, I always get the last notebook opened, I was mainly interested in avoiding the automatic opening of all other notebooks, especially the blank one. $\endgroup$– MosheCommented Oct 13, 2012 at 19:00
-
$\begingroup$ @Moshe that is answered here: mathematica.stackexchange.com/q/1383/121 $\endgroup$ Commented Oct 13, 2012 at 19:03
-
$\begingroup$ @Moshe Mr.Wizard's link answers that specific question. A complementary question then, is to open just a specific notebook each and every time. That is answered here: mathematica.stackexchange.com/q/8316/5 $\endgroup$– rm -rf ♦Commented Oct 13, 2012 at 19:04
-
$\begingroup$ @Mr.Wizard, thanks, I'll take a look. Maybe my question can be closed as a duplicate then. $\endgroup$– MosheCommented Oct 13, 2012 at 19:21