Apologies if there's an answer to this already...
I am creating a contour plot and want to add a circle to the plot using a script. When the plot is a standalone window it's easy, I add something like this:
SendToReport(
Dispatch(
{},
"Contour Plot Graph",
FrameBox,
{Add Graphics Script( 2, Description( "Script" ), Circle( {0, 0}, 3 ) )}
)However, I am including the plot in a larger report containing other charts. To do this, I have an outline box, containing several HListBox and VListBox instances. When I do that, I can no longer get the dispatch command to reach the contour plot. Instead I get an warning like:
Cannot find FrameBox[ "Contour Plot Graph" ] at {}The tree structure looks like this:

I've tried all sorts of combinations in the first argument of Dispatch and I can't work it out, so I'd be very grateful for some help!
Thanks.
Don't use Dispatch().
Send a message directly to the appropriate display box, the Frame Box in this case. Assuming that your window reference is stored in a variable window, try this:
window[OutlineBox("Contour Plot for x"][FrameBox(1)] << Add Graphics Script( 2, Description( "Script" ), Circle( {0, 0}, 3 ) );