Q:

Jupyter Notebook: command for save the current notebook?

I can automatically save the notebook into HTML after running code. However, sometimes the results are generated too quick, so the output HTML does not have the output in the last cells.
I'm wondering, if it is possible to tell the file to save itself?
Something like 
# In last cell
current_filename = 'my_file.ipynb'
save_current_notebook(current_filename)
output_HTML(current_filename)

Now I can get away with:
display(Javascript("IPython.notebook.save_notebook()"),            
        include=['application/javascript'])

A:

When the following cell is run, it automatically saves the notebook. 
%%javascript
IPython.notebook.save_notebook()

I put it as the last cell of the notebook I want to be saved as soon as its execution is completed.
The suggestion made by OP didn't work for me, but the above did. Thank you for the idea.

