Sza*_*lcs 9 wolfram-mathematica mathematica-frontend
如何检测前端令牌是否可以执行?或者,如何检测前端令牌是否未能执行?
示例:如果未选择任何内容,则"编辑" - >"复制"命令不可用. FrontEndTokenExecute["Copy"]在这种情况下会发出哔哔声,但它没有给我(编程)指示它已经失败了.
我找到了一种方法来处理你的第二个问题,但它并不优雅:
Preferences > Interface > Message and Warning actions设置次要用户界面警告到蜂鸣声和打印到控制台 Notebooks[]左右)NotebookGet[NotebookObject[FrontEndObject[LinkObject["55d_shm", 1, 1]], 1]]/. Notebook[{___, Cell[a___]}, ___] :> Cell[a](当你的句柄看起来不同时,将最后一个单元格存储在消息笔记本中
)Cell["You tried to edit a cell that is not editable. You can make the \
cell editable by choosing Cell Editable in the Cell Properties \
submenu.", "Message", "Message", "MSG", PageWidth -> WindowWidth,
ShowCellLabel -> True, CellChangeTimes -> {3.534442831*10^9},
CellTags -> "cantEditLockedCell"]