- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Add Script to Existing Script Group
As usual, not sure how I got here but I have a script that groups the embedded scripts in a JMP table if they contain the word "History" in the title. I have a script "Split Table" that I embed later that I would like to add to the "History" group of scripts. Is there an easy way to do that without disassembling the group in the first place?
lstScripts = Current Data Table() << Get Table Script Names;
History_scripts = {};
For( j = 1, j <= N Items( lstScripts ), j++,
If( Contains ( lstScripts[j] , "History" ),
Insert Into( History_scripts, lstScripts[j] )
)
);
Show(History_scripts);
Current Data Table() << Group Scripts( History_scripts ) << rename script group( "Tool History etc.", "History");
Slán
SpannerHead
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Add Script to Existing Script Group
Thanks Hogi. Somehow I'm not getting that to work (amateur hour probably). I'm using this and it works.
lstScripts = Current Data Table() << Get Table Script Names;
History_scripts = {};
For( j = 1, j <= N Items( lstScripts ), j++,
If( Contains ( lstScripts[j] , "History" ),
Insert Into( History_scripts, lstScripts[j] )
)
);
For( j = 1, j <= N Items( lstScripts ), j++,
If( Contains( lstScripts[j], "Split Table" ),
Insert Into( History_scripts, lstScripts[j] )
)
);
Current Data Table() << Group Scripts( History_scripts );
Slán
SpannerHead
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Add Script to Existing Script Group
It looks like you will need to get the names of the scripts in the history group using
Get Script Group
Then ungroup the scripts using
Ungroup Scripts
Then add your the script name that you want to add to the history group
If the history group name list is hisgp
insert into(hisgp, <the new script name to be added>(
Then create the history group using the updated list using
Group Scripts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Add Script to Existing Script Group
Hm , I did not find such a function.
But it's easy to generate it:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << group scripts(
"myGroup",
{"Graph Builder Smoother Line", "Graph Builder Line and Bar Charts",
"Graph Builder Line Chart", "Graph Builder Heat Map"}
);
insert Script = Function( {dt, groupName, scriptName},
//{default local},
myList = dt << get script group( groupName );
Insert Into( myList, scriptName );
dt << group scripts( groupName, mylist );
);
insert Script( dt, "myGroup", "Logistic" )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Add Script to Existing Script Group
Now I found it:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << group scripts(
"myGroup",
{"Graph Builder Smoother Line", "Graph Builder Line and Bar Charts",
"Graph Builder Line Chart", "Graph Builder Heat Map"}
);
dt << group scripts("myGroup", "Logistic")
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Add Script to Existing Script Group
"I"
... actually it was him:
And now I remember ...
I accidentally detected this trick and used it in
https://marketplace.jmp.com/appdetails/Graph+Builder+Toolbar / SendToPowerpoint to add scripts of exported graphs to
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Add Script to Existing Script Group
Thanks Hogi. Somehow I'm not getting that to work (amateur hour probably). I'm using this and it works.
lstScripts = Current Data Table() << Get Table Script Names;
History_scripts = {};
For( j = 1, j <= N Items( lstScripts ), j++,
If( Contains ( lstScripts[j] , "History" ),
Insert Into( History_scripts, lstScripts[j] )
)
);
For( j = 1, j <= N Items( lstScripts ), j++,
If( Contains( lstScripts[j], "Split Table" ),
Insert Into( History_scripts, lstScripts[j] )
)
);
Current Data Table() << Group Scripts( History_scripts );
Slán
SpannerHead