1
$\begingroup$

I've tried various ways to specify a notebook's Saveable option, all unsuccessful.

For example, using an external editor, I edited test.nb's source code to change the expression

Saveable->False,

...to

Saveable->Module[
  {value = Environment["SAVEABLE"]},
  If[value === $Failed, False, ToExpression[value]]
],

...and then ran the following from the command line:

SAVEABLE=True mathematica &

The notebook did come up, but so did the Messages window, with the following error:

The specified setting for the option Saveable cannot be used.

(Putting an Evaluate around the Module expression made no difference.)


Is there some other way to do this?

$\endgroup$

1 Answer 1

1
$\begingroup$

Try putting this in an initialization cell in your notebook.

Module[{val, update},
  update = If[BooleanQ[val = ToExpression[Environment["SAVEABLE"]]], val, False];
  CurrentValue[EvaluationNotebook[], Saveable] = update]
$\endgroup$

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.