Hi @matt7109,
The menu and toolbars you see are limited to one per window. You will need to create your own custom behaviors for actions (like save) that would typically be done using the menu or toolbars.
The below script creates a red triangle menu that will save the data table within the Outline Box. Notice that I turned on the "Data Table List" in the toolbar so that you can see the current data table. With this method, you can still use the menus (Tables, DOE, Analyze, Graph) that will perform actions on the current data table shown in the data table list.
Names Default To Here( 1 );
// open the tables as private
dt1 = Open( "$SAMPLE_DATA\Big Class.jmp", private );
dt2 = Open( "$SAMPLE_DATA\Bands Data.jmp", private );
// Create a function to create each data table to reduce code redundancy
getDataTableOutlineBox = Function( {dt},
Eval(
Eval Expr(
Outline Box( dt << Get Name, // title of the tab
dt << New Data Box(), //DataBrowserBox
// Add scripts to the Red Triangle menu for the Outline Box
<<Set Menu Script(
{
"Save As", // Name of the menu item script
// get path to save the data table
savePath = Pick File(
"Save JMP Data Table",
"",
{"JMP Files|jmp", "All Files|*"},
1,
1,
Expr( dt << get name ) || ".jmp" // evaluate the name of the table when the menu script is added
);
// If the user selected a path, save the table at that path
If( savePath != "",
Expr( dt ) << save( savePath )
);
}
)
)
)
)
);
// (optional) Turn on the Data Table list for reports so that you can see what the current data table is
Set Toolbar Visibility( "Data Table List", Report, true );
// Create a window with both tables shown
New Window( "Both Tables",
Suppress AutoHide( 1 ), // Suppress the auto hide so that the toolbars appear
<<OnClose(
Try( Close( dt1, NoSave ) );
Try( Close( dt2, NoSave ) );
),
H Splitter Box(
size( 1200, 800 ),
getDataTableOutlineBox( dt1 ),
getDataTableOutlineBox( dt2 ),
)
);
Below is a screenshot of the window after clicking on the Red Triangle Menu.
Justin