4
$\begingroup$

I wrote a notebook containing initialization cells:

(1) notebook's options related to initialization are set to:

InitializationCellEvaluation -> True
InitializationCellWarning -> False

(2) the notebook is placed into a trusted directory.

By the way, TrustByDefault is True.

However, in spite of that, I constantly receive the "Do you want automatically evaluate all initilization cells in the notebook" and "This file contains potentially unsafe content" warnings.

(Q1) Why does it happen ?

(Q2) Here Notebook Initialization is said (about a quite different situation):

I believe that I now know the answer. In addition to setting InitializationCellEvaluation option to True InitializationCellWarning option to False with the notebook selected, you also need to set these same values at the Global Preference level.

Admitted that this is pertinent to my case, I can't see, nor in Options Inspector > Global Preferences neither in tutorial/NotebookSecurity an explict indication. (8.0.1.0)

$\endgroup$
1
  • 2
    $\begingroup$ "In order for the warning not to occur, this option must be set to False both in the notebook being opened and at the global level. This is a security feature to prevent a notebook from silently evaluating cells without the user’s knowledge, unless the user has specifically enabled this by setting the option to False at the global level."[reference.wolfram.com/language/ref/… $\endgroup$
    – Karsten7
    May 19, 2016 at 11:59

1 Answer 1

3
$\begingroup$

You could simply do

SetOptions[$FrontEndSession, {InitializationCellEvaluation -> True,
  InitializationCellWarning -> False}];

Now Initialization Cells are evaluated without the warning even when these options are not set at the Notebook level explicitly: actually they are simply inherited by Notebook from the top level (from the $FrontEndSession).

$\endgroup$
2
  • $\begingroup$ Thanks: it works fine ! I wonder why InitializationCellEvaluation and InitializationCellWarning options are not shown by Options Inspector ... $\endgroup$ May 19, 2016 at 12:19
  • 1
    $\begingroup$ @mitochondrial At least these options are listed in AbsoluteOptions[$FrontEnd]: try FilterRules[ AbsoluteOptions[$FrontEnd], {InitializationCellEvaluation, InitializationCellWarning}]. $\endgroup$ May 19, 2016 at 12:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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