cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

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

How to make a toolbar script that runs "Save script to data table"?

I saw the below very inspiring talk from Steve Hampton, about saving clicks, and have since then made myself a number of time-saving toolbar scripts. One thing I do repeatedly is "save script to data table" whenever I think I made a nice graph, to prevent myself from destroying it when trying to refine it.  Every save takes me a handful of clicks. Tried to make a script for that, but no success.

 

I would be very happy for suggestions on how to make such a script to embed in  a toolbar.

 

Stay in the Flow With Custom Scripts and Toolbars (2022-US-30MP-1081) - JMP User Community

3 ACCEPTED SOLUTIONS

Accepted Solutions
jthi
Super User

Re: How to make a toolbar script that runs "Save script to data table"?

This will most definitely require error-handling and some checks but basic idea could be: use XPath to find outlineboxes with helpkey attribute and then get scriptable object from those and then send the message.

Names Default To Here(1);

obs = (Current Report() << XPath("//OutlineBox[@helpKey]"));
objs = obs << Get Scriptable Object;
objs[1] << Save Script to Data Table;

There might also be better messages than << Save Script to Data Table (Save Script for All Objects or Save Script for All Objects To Data Table)

-Jarmo

View solution in original post

shampton82
Level VII

Re: How to make a toolbar script that runs "Save script to data table"?

Hey @Ake !

Glad the talk was inspiring!  @jthi once again has provided a great scripting option but I was wondering if the build in toolbar "Report" would also work for you.  It has a "Save Script to Data table" button in it.

shampton82_0-1743694063108.png

 

Steve

 

View solution in original post

jthi
Super User

Re: How to make a toolbar script that runs "Save script to data table"?

That is even better as it will be much more robust than trying to tinker with as it uses the built-in command.

 

Edit: I did remember that you could run those built-in commands also somehow, and it was via Main Menu (if you for some reason wish to script it)

jthi_3-1743694649705.png

 

Main Menu("PLATFORM:SAVE SCRIPT:SAVE SCRIPT TO DATA TABLE")

jthi_2-1743694427442.png

-Jarmo

View solution in original post

5 REPLIES 5
jthi
Super User

Re: How to make a toolbar script that runs "Save script to data table"?

This will most definitely require error-handling and some checks but basic idea could be: use XPath to find outlineboxes with helpkey attribute and then get scriptable object from those and then send the message.

Names Default To Here(1);

obs = (Current Report() << XPath("//OutlineBox[@helpKey]"));
objs = obs << Get Scriptable Object;
objs[1] << Save Script to Data Table;

There might also be better messages than << Save Script to Data Table (Save Script for All Objects or Save Script for All Objects To Data Table)

-Jarmo
Ake
Ake
Level IV

Re: How to make a toolbar script that runs "Save script to data table"?

That worked nicely! I went for the All Objects variant. Many thanks @jthi for always being fast and helpful!

shampton82
Level VII

Re: How to make a toolbar script that runs "Save script to data table"?

Hey @Ake !

Glad the talk was inspiring!  @jthi once again has provided a great scripting option but I was wondering if the build in toolbar "Report" would also work for you.  It has a "Save Script to Data table" button in it.

shampton82_0-1743694063108.png

 

Steve

 

jthi
Super User

Re: How to make a toolbar script that runs "Save script to data table"?

That is even better as it will be much more robust than trying to tinker with as it uses the built-in command.

 

Edit: I did remember that you could run those built-in commands also somehow, and it was via Main Menu (if you for some reason wish to script it)

jthi_3-1743694649705.png

 

Main Menu("PLATFORM:SAVE SCRIPT:SAVE SCRIPT TO DATA TABLE")

jthi_2-1743694427442.png

-Jarmo
Ake
Ake
Level IV

Re: How to make a toolbar script that runs "Save script to data table"?

Thanks for the input! I will try both methods (built-in two-click and scripted one-click) to see what sticks! Thanks a lot to both @shampton82 and @jthi for never failing support!

Recommended Articles