I would like a notebook to behave slightly differently depending on whether it is evaluated from another notebook; i.e.,
NotebookEvaluate[$UserDocumentsDirectory <> "/Mathematica/notebook.nb"]
How can the target notebook know when it has been called by another notebook?
Answer
Why not just set a symbol to have a value within the calling notebook? Something like...
$callingNotebook = EvaluationNotebook[];
Then in the called notebook see if $callingNotebook has a value.
Comments
Post a Comment