cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
Thierry_S
Super User

JSL Optimization for speed: Avoiding repeated calls to Save Presentation ("File", Append)

Hi JMP Community,

 

I'm making some progress in my attempt to generate PowerPoint slides assembled from the Plots stored in multiple journals (JRN) files.

The following script produces the right output but it is quite slow most likely due to the repeated calls to << Save Presentation ("file_name", Append).

I think it would be much faster to aggregate the different plots in a master container (new window or new Journal) and then use Save Presentation only once for the entire master container. How could I do this: I'm getting a bit confused about the nesting of different display structures.

Names Default to Here (1);

dummy = H List Box ();

dummy << Save Presentation ("C:\Users\sornstr\Desktop\TEMP PNG\NEW OUTPUT.pptx", Template ("C:\Users\sornstr\Desktop\JMP Scripts\SANDBOX\JMPExportTemplate_TS.pptx"), Outline Titles (Top Left));

jrn1 = Get Window("Journal: FIRST JOURNAL");
jrn2 = Get Window("Journal: SECOND JOURNAL");



For (i = 0, i <50, i++, 
	
	Plot1 = jrn1 [PictureBox(i+1)];
	Plot2 = jrn2 [PictureBox(i+1)];
	TitleTxt = jrn1 [TextEditBox((i*3)+1)] << get text;
	
	Show (TitleTxt);
		
	MylpBox = Lineup Box (N Col (4));
	
	SPRI = SpacerBox (size (50,50)) << get picture;
	
	MylpBox << Append (SPRI);
	MylpBox << Append (Plot1);
	MylpBox << Append (Plot2);
	MylpBox << Append (SPRI);
	
	PLOTS  = MylpBox << get picture;
	
	nw = New Window ("SERENE UC",
					OutlineBox(TitleTxt,
							
							PictureBox (PLOTS)
								
							)
						
					);
		
	nw << Save Presentation ("C:\Users\sornstr\Desktop\TEMP PNG\NEW OUTPUT.pptx", Append, Outline Titles (Top Left));
	
	nw << close window;
	
);	

open ("C:\Users\sornstr\Desktop\TEMP PNG\NEW OUTPUT.pptx");

Thank you for your help.

 

Sincerely,

 

TS

 

Thierry R. Sornasse
1 ACCEPTED SOLUTION

Accepted Solutions
Thierry_S
Super User

Re: JSL Optimization for speed: Avoiding repeated calls to Save Presentation ("File", Append)

Hi JMP community,

 

I solved my problem: I just needed to create a new journal into which I placed the composite plots (see below).

 

Names Default to Here (1);

jrn1 = Get Window("FIRST_JOURNAL");
jrn2 = Get Window("SECOND_JOURNAL");
jrn_out = New Window ("COMPIL",<< journal);


For (i = 0, i <3, i++, 
	
	Plot1 = jrn1 [PictureBox(i+1)];
	Plot2 = jrn2 [PictureBox(i+1)];
	TitleTxt = jrn1 [TextEditBox((i*3)+1)] << get text;
	
	Show (TitleTxt);
		
	MylpBox = Lineup Box (N Col (4));
	
	SPRI = SpacerBox (size (50,50)) << get picture;
	
	MylpBox << Append (SPRI);
	MylpBox << Append (Plot1);
	MylpBox << Append (Plot2);
	MylpBox << Append (SPRI);
	
	PLOTS  = MylpBox << get picture;
	
	nw = New Window ("SERENE UC",
					OutlineBox(TitleTxt,
							
							PictureBox (PLOTS)
								
							)
						
					);
		

	jrn_out << Append (nw);
	nw << close window;
	
);	
jrn_out << Save Presentation ("C:\Users\sornstr\Desktop\TEMP PNG\NEW OUTPUT.pptx", Template ("C:\Users\sornstr\Desktop\JMP Scripts\SANDBOX\JMPExportTemplate_TS.pptx"), Outline Titles (Top Left));
open ("C:\Users\sornstr\Desktop\TEMP PNG\NEW OUTPUT.pptx");
Thierry R. Sornasse

View solution in original post

1 REPLY 1
Thierry_S
Super User

Re: JSL Optimization for speed: Avoiding repeated calls to Save Presentation ("File", Append)

Hi JMP community,

 

I solved my problem: I just needed to create a new journal into which I placed the composite plots (see below).

 

Names Default to Here (1);

jrn1 = Get Window("FIRST_JOURNAL");
jrn2 = Get Window("SECOND_JOURNAL");
jrn_out = New Window ("COMPIL",<< journal);


For (i = 0, i <3, i++, 
	
	Plot1 = jrn1 [PictureBox(i+1)];
	Plot2 = jrn2 [PictureBox(i+1)];
	TitleTxt = jrn1 [TextEditBox((i*3)+1)] << get text;
	
	Show (TitleTxt);
		
	MylpBox = Lineup Box (N Col (4));
	
	SPRI = SpacerBox (size (50,50)) << get picture;
	
	MylpBox << Append (SPRI);
	MylpBox << Append (Plot1);
	MylpBox << Append (Plot2);
	MylpBox << Append (SPRI);
	
	PLOTS  = MylpBox << get picture;
	
	nw = New Window ("SERENE UC",
					OutlineBox(TitleTxt,
							
							PictureBox (PLOTS)
								
							)
						
					);
		

	jrn_out << Append (nw);
	nw << close window;
	
);	
jrn_out << Save Presentation ("C:\Users\sornstr\Desktop\TEMP PNG\NEW OUTPUT.pptx", Template ("C:\Users\sornstr\Desktop\JMP Scripts\SANDBOX\JMPExportTemplate_TS.pptx"), Outline Titles (Top Left));
open ("C:\Users\sornstr\Desktop\TEMP PNG\NEW OUTPUT.pptx");
Thierry R. Sornasse