Wolfram Research

Function Repository Resource:

PrintMessage

Source Notebook

Print expressions to the messages window

Contributed by: Michael Sollami

ResourceFunction["PrintMessage"][expr]

prints expression expr to the messages window.

Details and Options

Expressions will be written to the messages window in OutputForm.
Adding the option Visible True will open the messages window if it is not already open.

Examples

Basic Examples

Print to the console:

In[1]:=
ResourceFunction["PrintMessage"]@"This is a test"
Out[1]=

Scope

Print any expression:

In[2]:=
ResourceFunction["PrintMessage"]@
 Graphics3D[
  Table[With[{p = {i, j, k}/5}, {RGBColor[p], Opacity[.75], Cuboid[p, p + .15]}], {i, 5}, {j, 5}, {k, 5}]]
Out[2]=

Options

Visible

If the Messages window is not open, you can force it to appear:

In[3]:=
ResourceFunction["PrintMessage"]["Read me!", Visible -> True]

Requirements

Wolfram Language 11.3 (March 2018) or above

Resource History

License Information