Scripting Guide > Creating Projects > Close Tabs in Projects
发布日期: 08/07/2020

Close Tabs in Projects

Close a tab in a project by identifying the window with Get Window() and then closing it with Close Window.

project = New Project();
project << Run Script(
	dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
	dt << Run Script( "Bivariate" );
	dt << Run Script( "Distribution" );
);
 
Wait( 2 ); // for demonstration purposes
 

// returns a reference to the open "Big Class - Distribution" window

dist = Get Window( Project( project ), "Big Class - Distribution" ) ;
dist << Close Window();

To close all tabs in a project, use Get Window List << Close Window().

project = New Project();
project << Run Script(
	dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
	dt << Run Script( "Bivariate" );
	dt << Run Script( "Distribution" );
);
 
Wait( 2 ); // for demonstration purposes
 
Get Window List( Project( project ) ) << Close Window();
需要更多信息?有问题?从 JMP 用户社区得到解答 (community.jmp.com).