Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

up vote 2 down vote accepted

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:

How do I prevent auto loading of blank notebook at startup?

share|improve this answer

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:

share|improve this answer
    
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. –  Moshe Oct 13 '12 at 19:00
    
@Moshe that is answered here: mathematica.stackexchange.com/q/1383/121 –  Mr.Wizard Oct 13 '12 at 19:03
    
@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 –  rm -rf Oct 13 '12 at 19:04
    
@Mr.Wizard, thanks, I'll take a look. Maybe my question can be closed as a duplicate then. –  Moshe Oct 13 '12 at 19:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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