NotebookReadAsync
Reads the content for the notebook or from a given cell, storage async and safe:
Syntax
Read focused cell:
NotebookReadAsync[notebook_RemoteNotebook]Read multiple items:
NotebookReadAsync[{item1, item2, ...}]Read cell content:
NotebookReadAsync[cell_RemoteCellObj]Read notebook storage:
NotebookReadAsync[store_NotebookStore]it will always return Promise or a list of them.
Use Then or Await to resolve them, for example:
nb = EvaluationNotebook[];
Button["Print focused", Then[NotebookReadAsync[nb], Function[focused,
Then[NotebookReadAsync[focused], Function[cell,
Print[cell[[1]]];
]]
]]]