cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
RahBarroso
Level II

How to grab OutlineBox title with 'Get Script'

Hi,

 

I'm trying to use the 'get script' function to grab information about a report that I can combine together to a .jrp file (similar to the details in this post except I'm going to add some extra components that will run on boot for the .jrp, hence why I'm not using the 'Save Report Window' function). The problem I'm having is that I need to grab the OutlineBox titles (which are named by the script, and are tracked in case of changes in my wider project) as well, otherwise I can't actually recreate the report. See the example below.

 

Am I missing something in the 'get script' function to bring in the OutlineBox titles as well?

 

names default to here(1);
report_win = New Window("Testwindow",
    Outline Box("tester",
    	Textbox("Test")
    )
    );

report_win << Get Script;

//RESULT: V List Box( V List Box( Outline Box( Text Box( "Test" ) ) ) )

//If I were to take that same script and try to recreate as a jrp file works....
//New Window("test", V List Box( V List Box( Outline Box( Text Box( "Test" ) ) ) ))
//resulting failure: expected character arg 1 in access or evaluation of 'Outline Box' , Outline Box/*###*/(Text Box( "Test" ))

2 REPLIES 2
jthi
Super User

Re: How to grab OutlineBox title with 'Get Script'

I'm not sure you can use << Get Script for what you are trying to do. And what you could/should do depends on your end goal. I'm pretty sure I'm missing something on why you couldn't use << Save Window Report but it could be one option

Names Default To Here(1);
report_win = New Window("Testwindow", << Type("Report"), Outline Box("tester", Text Box("Test")));

report_win << Save Window Report("$TEMP/test.jrp");
s1 = report_win << get script;
wait(0);
s2 = Parse(Load Text File("$TEMP/test.jrp"));
wait(0);
Delete File("$TEMP/test.jrp");

Show(s1, s2);

ob_script = Extract Expr(s2, Outline Box(WildList()));
s1 = V List Box(V List Box(OutlineBox(Text Box("Test"))));
s2 = New Window("Testwindow", Outline Box("tester", Text Box("Test")));
Outline Box("tester", Text Box("Test"))
-Jarmo

Re: How to grab OutlineBox title with 'Get Script'

I think using XPath might be simpler and more direct. See this illustration:

Names Default to Here( 1 );

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

biv = dt << Bivariate( Y( :weight ), X( :height ), Fit Line( 1 ) );

rpt = biv << Report;

outlineNames = (rpt << XPath( "//OutlineBox" )) << Get Title;

Recommended Articles