BookmarkSubscribeRSS Feed
Ainaskid

Occasional Contributor

Joined:

Feb 28, 2018

JSL- I don't see the corresponding script for corresponding GUI step

Hello community,

I'm new to JSL so my question may come across as daft. I'm in the process of automating a charted report for my team which is to be published on a weekly basis. I'm working in the JMP GUI and saving the scripts generated in the background. The steps i've attempted so far are:

1. Import data table (successfully saved working script)

2. Modify data table by creating a new column and populating it with 'char'/'nominal' variables. The plan is to utilize this column to create subset tables. For some reason the new column, along with its contents do not show up in the background JSL script. When I perform a 'subset' using the newly created variables, the corresponding script gets created. When I attempt running the entire script from start to finish, all it does is import the source data (likely due to the fact that the remaining portion of the script is attempting to create a subset using collumn names that don't exist in the source data). So far this has stunted my progress.

Any pointers?

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
txnelson

Super User

Joined:

Jun 22, 2012

Solution

Re: JSL- I don't see the corresponding script for corresponding GUI step

The creation of new columns is not saved in what you are calling "Background Scripts";  You need to input that code manually into the script.

See

     Help==>Scripting Index==>Data Table==>Data Table Cols==>New Column

Here is one of the examples from that entry

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << New Column( "X",
	Formula( Random Uniform() )
);
Jim
julian

Staff

Joined:

Jun 25, 2014

Solution

Re: JSL- I don't see the corresponding script for corresponding GUI step

Hi @Ainaskid,

As you noticed creating a new column does not generate a "source" script in the table the way subsetting or importing does, but the JSL to recreate the column is actually there, accessible via scripting by sending the <<Get Script message to the column itself. I do this so often I put together an Add-in (Copy Script for Selected Column(s) to Clipboard) that will copy the column recreation script to the clipboard so you can use it in other code you're writing to script a workflow. Hopefully this helps some!

@julian

 

edit: Also, after rereading your post I'd like to clarify what the "source" script you're running refers to. Actions in JMP that produce a table (like importing, subsetting, summarizing, etc) will save a script to the created table and call it "source." As you perform other actions in JMP that script is not updated -- it is there just so you have the jsl for that one action you did that created a table. So, if you're trying to script an entire workflow, what you will want to do is make a new blank script (File > New > New Script) that you use to hold all the script pieces you need to recreate your entire workflow. For example, you would want to place your import script in there (right click the source script > edit, then copy-paste that code to your new windows), then your script for creating your new columns (using my Add-in, or writing the jsl yourself as Jim suggested), then the subset script you get after taking a subset (which will be in the source script you have in the new table after performing the subset). If you're looking to see some of this process in action, I gave a webinar on scripting a scientific workflow in JMP that might be helpful. 

5 REPLIES
txnelson

Super User

Joined:

Jun 22, 2012

Solution

Re: JSL- I don't see the corresponding script for corresponding GUI step

The creation of new columns is not saved in what you are calling "Background Scripts";  You need to input that code manually into the script.

See

     Help==>Scripting Index==>Data Table==>Data Table Cols==>New Column

Here is one of the examples from that entry

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << New Column( "X",
	Formula( Random Uniform() )
);
Jim
Ainaskid

Occasional Contributor

Joined:

Feb 28, 2018

Re: JSL- I don't see the corresponding script for corresponding GUI step

Thanks Jim. I'll give that a shot.

julian

Staff

Joined:

Jun 25, 2014

Solution

Re: JSL- I don't see the corresponding script for corresponding GUI step

Hi @Ainaskid,

As you noticed creating a new column does not generate a "source" script in the table the way subsetting or importing does, but the JSL to recreate the column is actually there, accessible via scripting by sending the <<Get Script message to the column itself. I do this so often I put together an Add-in (Copy Script for Selected Column(s) to Clipboard) that will copy the column recreation script to the clipboard so you can use it in other code you're writing to script a workflow. Hopefully this helps some!

@julian

 

edit: Also, after rereading your post I'd like to clarify what the "source" script you're running refers to. Actions in JMP that produce a table (like importing, subsetting, summarizing, etc) will save a script to the created table and call it "source." As you perform other actions in JMP that script is not updated -- it is there just so you have the jsl for that one action you did that created a table. So, if you're trying to script an entire workflow, what you will want to do is make a new blank script (File > New > New Script) that you use to hold all the script pieces you need to recreate your entire workflow. For example, you would want to place your import script in there (right click the source script > edit, then copy-paste that code to your new windows), then your script for creating your new columns (using my Add-in, or writing the jsl yourself as Jim suggested), then the subset script you get after taking a subset (which will be in the source script you have in the new table after performing the subset). If you're looking to see some of this process in action, I gave a webinar on scripting a scientific workflow in JMP that might be helpful. 

Ainaskid

Occasional Contributor

Joined:

Feb 28, 2018

Re: JSL- I don't see the corresponding script for corresponding GUI step

This is very helpful. Thanks.
Ainaskid

Occasional Contributor

Joined:

Feb 28, 2018

Re: JSL- I don't see the corresponding script for corresponding GUI step

Thanks again Julian. I just realized i didn't respond to your question. What i'm doing is saving the source script for each action into a new script and then running the 'new script'. I'm watching your webinar at the moment. I'll give the whole process of creating this report another shot once i'm done. I'll let you/the community know if i have any further questions.

Thanks.