How can I detect if a front end token is available to execute? Alternately, how can I detect if a front end token failed to execute?
Example: the Edit -> Copy command is not available if nothing is selected. FrontEndTokenExecute["Copy"]
will simply beep in this case, but it gives me no (programmatic) indication that it has failed.
*Q and found NotebookTools
CellsSelectedQ. (I have not tried using it; dunno exactly how this is supposed to be evaluated.) Also see my comment on Sjoerd's answer regarding hiding the message window. Finally, you might also hunt through ?FrontEnd** and ?FrontEnd
*`*Q* for more ideas. – NeologismNotebookTools`
. I can't use this because it only returnsTrue
if full cells are selected (not just text in the cells), but looking at the source is already good inspiration. Perhaps I can come up with something more efficient thanNotebookRead@SelectedNotebook[]
. – Stouthearted