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
lad1
Level II

How to Change HTML Title During Save as HTML

Hi,

 

I have JSL script which uses

Save HTML

to convert Jmp summary table and Chart to HTML file. Currently, each HTML file has title of "JMP Output" as shown below.

 

First line in HTML file post conversion:

<!doctype html public "-//W3C//DTD HTML 4.0//EN"><html><head><title>JMP Output</title></head><body>

 

I have several HTML files and would like to distinguish tab in web browser by unique title. Is there a way of converting Jmp data to HTML with option to set title in HTML file?

 

I am currently using Jmp12.

Thanks!

2 ACCEPTED SOLUTIONS

Accepted Solutions
txnelson
Super User

Re: How to Change HTML Title During Save as HTML

There have not been any additions to the Save HTML() function in JMP 15.  However, you can simply read the file back in and change the title to whatever you want, and then save it back again.......as you suggested

Names Default To Here( 1 );

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
biv = dt << Bivariate( y( :weight ), x( :height ) );
rbiv = biv << report;

// Save the display
rbiv << Save HTML( "$TEMP/myversion2.html" );

// Read it back into JMP as a text string
myHTML = load text file("$TEMP/myversion2.HTML");

// Modify the "JMP Output", to whatever you want
myHTML = substr(myHTML, 1, contains(myHTML,"JMP Output")-1) || "This is the Title" ||
	substr(myHTML, contains(myHTML,"JMP Output")+10);

// Save the file back to the original location
save text file("$TEMP/myversion.HTML", myHTML);

// Open the HTML file as validation
open("$TEMP/myversion.HTML");
Jim

View solution in original post

lad1
Level II

Re: How to Change HTML Title During Save as HTML

 That works for me! No need to use other scripting language. Thanks Jim.

View solution in original post

5 REPLIES 5
txnelson
Super User

Re: How to Change HTML Title During Save as HTML

There does not seem to be an option in JMP 12 to change the window title in the HTML.
Jim
lad1
Level II

Re: How to Change HTML Title During Save as HTML

If I upgrade to Jmp15, would I get the required feature that allows changing HTML title?  If not, is there any other way in JSL to change HTML title or should I simply resort to Python to update HTML file title string?

txnelson
Super User

Re: How to Change HTML Title During Save as HTML

There have not been any additions to the Save HTML() function in JMP 15.  However, you can simply read the file back in and change the title to whatever you want, and then save it back again.......as you suggested

Names Default To Here( 1 );

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
biv = dt << Bivariate( y( :weight ), x( :height ) );
rbiv = biv << report;

// Save the display
rbiv << Save HTML( "$TEMP/myversion2.html" );

// Read it back into JMP as a text string
myHTML = load text file("$TEMP/myversion2.HTML");

// Modify the "JMP Output", to whatever you want
myHTML = substr(myHTML, 1, contains(myHTML,"JMP Output")-1) || "This is the Title" ||
	substr(myHTML, contains(myHTML,"JMP Output")+10);

// Save the file back to the original location
save text file("$TEMP/myversion.HTML", myHTML);

// Open the HTML file as validation
open("$TEMP/myversion.HTML");
Jim
lad1
Level II

Re: How to Change HTML Title During Save as HTML

 That works for me! No need to use other scripting language. Thanks Jim.

txnelson
Super User

Re: How to Change HTML Title During Save as HTML

I am a bit confused....the response you marked as being the solution does not have a solution in it. The purpose of marking an entry as a solution is to provide a direct route for future readers to get the information they need quickly. I suggest you remove the Solution marker for your response, and to mark the response that actually shows the solution.
Jim