<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Populate a collistbox from the clipboard in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Populate-a-collistbox-from-the-clipboard/m-p/353447#M60295</link>
    <description>&lt;P&gt;That worked really well!&lt;/P&gt;&lt;P&gt;I added your code to this and I'm good to go:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;selCols = dt &amp;lt;&amp;lt; Get selected Columns( String );

obj2=new window("Reponse Variable",
			&amp;lt;&amp;lt;Modal,
			&amp;lt;&amp;lt;Return Result,
			LineupBox( NCol( 1 ), Spacing( 5 ),
			choseny = ColListBox( dt, all, &amp;lt;&amp;lt;Set Data Type( "Numeric" ) )
			),
			V List Box(
				chosenx = ColListBox(dt,&amp;lt;&amp;lt;append(eval(selcols))),
			),
			H List Box( Button Box( "OK" ), Button Box( "Cancel" ) )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 27 Jan 2021 21:45:04 GMT</pubDate>
    <dc:creator>shampton82</dc:creator>
    <dc:date>2021-01-27T21:45:04Z</dc:date>
    <item>
      <title>Populate a collistbox from the clipboard</title>
      <link>https://community.jmp.com/t5/Discussions/Populate-a-collistbox-from-the-clipboard/m-p/353421#M60288</link>
      <description>&lt;P&gt;I am looking for a way to populate a collistbox from a list of columns in the clipboard.&amp;nbsp; I tried the getclipboard() command but since the list that is returned isn't a list of columns names this approach fails.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For background, I am copying a list of column names out of one datatable (the names are listed in the rows) and using the copied list of column names as the input for an analysis in another datatables analysis.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I just open the analysis platform (NN) and right click on the X input box I can paste in the column names.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="shampton82_0-1611779440907.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/29784iF5012EC631A3200D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="shampton82_0-1611779440907.png" alt="shampton82_0-1611779440907.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="shampton82_1-1611779481043.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/29785iE51D02998A15823D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="shampton82_1-1611779481043.png" alt="shampton82_1-1611779481043.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like for the terms to show up in the second box:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="shampton82_2-1611779531506.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/29786iCF4943FDC1553AF6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="shampton82_2-1611779531506.png" alt="shampton82_2-1611779531506.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So I'd copy the column names and run my script and the columns would be able to be selected in the optional box.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for any ideas!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 22:04:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Populate-a-collistbox-from-the-clipboard/m-p/353421#M60288</guid>
      <dc:creator>shampton82</dc:creator>
      <dc:date>2023-06-09T22:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: Populate a collistbox from the clipboard</title>
      <link>https://community.jmp.com/t5/Discussions/Populate-a-collistbox-from-the-clipboard/m-p/353445#M60293</link>
      <description>&lt;P&gt;Maybe there is an easier way, but I think the variable clip_items in the script below would get you started.&amp;nbsp; This takes each line in the clipboard and looks for a matching column.&amp;nbsp; The rest of the script selects those columns in the data table table.&amp;nbsp; I run this script from a menu as part of an add-in.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);

dt = current data table();

//Get list of columns in clipboard
clip_input = Get Clipboard();
clip = clip_input;

clip_items = {};

done = 0;
for( i = 1, done == 0 &amp;amp; i &amp;lt;= 10000, i++,
	show(clip);
	If ( 
		N Items(Regex Match(clip,"[\!\r\!\n]")) == 0
	,
		if( 
			length(clip) &amp;gt; 0
		, 
			Insert Into( clip_items, clip)
		);
		done = 1;
	,
		thisrow = Regex(clip,"(.+?)[\!\r\!\n]","\!\1");
		if( length(thisrow) &amp;gt; 0, Insert Into( clip_items, thisrow) ) ;
		clip = Regex(clip,"\!\n(.*)","\1");
	);
		
);

if( i &amp;gt; 10000, throw("found more than 10000 variables"));

col_names = dt &amp;lt;&amp;lt;  Get Column Names( String );

For( i = 1, i &amp;lt;= N Items( col_names ), i++,
	if( contains( clip_items, col_names[i] ),
		Column( dt, i ) &amp;lt;&amp;lt; Set Selected ( 1 );,
		Column( dt, i ) &amp;lt;&amp;lt; Set Selected( 0 );,
	)
);&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 21:52:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Populate-a-collistbox-from-the-clipboard/m-p/353445#M60293</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2021-01-27T21:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: Populate a collistbox from the clipboard</title>
      <link>https://community.jmp.com/t5/Discussions/Populate-a-collistbox-from-the-clipboard/m-p/353447#M60295</link>
      <description>&lt;P&gt;That worked really well!&lt;/P&gt;&lt;P&gt;I added your code to this and I'm good to go:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;selCols = dt &amp;lt;&amp;lt; Get selected Columns( String );

obj2=new window("Reponse Variable",
			&amp;lt;&amp;lt;Modal,
			&amp;lt;&amp;lt;Return Result,
			LineupBox( NCol( 1 ), Spacing( 5 ),
			choseny = ColListBox( dt, all, &amp;lt;&amp;lt;Set Data Type( "Numeric" ) )
			),
			V List Box(
				chosenx = ColListBox(dt,&amp;lt;&amp;lt;append(eval(selcols))),
			),
			H List Box( Button Box( "OK" ), Button Box( "Cancel" ) )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Jan 2021 21:45:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Populate-a-collistbox-from-the-clipboard/m-p/353447#M60295</guid>
      <dc:creator>shampton82</dc:creator>
      <dc:date>2021-01-27T21:45:04Z</dc:date>
    </item>
  </channel>
</rss>

