<?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 How to use Name Expr of functions inside dt &amp;lt;&amp;lt; New Script in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-use-Name-Expr-of-functions-inside-dt-lt-lt-New-Script/m-p/907784#M106603</link>
    <description>&lt;P&gt;I have a JSL script that has the following:&lt;BR /&gt;There is a function stored in a variable toJournal:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;toJournal = Function({},
     //some commands
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I want to call this function inside a New Script message:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; New Script&lt;/CODE&gt;("save presentation",&lt;BR /&gt;toJournal();&lt;BR /&gt;journal &amp;lt;&amp;lt; save presentation();&lt;BR /&gt;);&lt;/PRE&gt;
&lt;P&gt;however due to name scope where I use names default to here(1) in my main script, the function toJournal isn't known when running the save presentation script button in the Data Table.&lt;BR /&gt;&lt;BR /&gt;I would like to use Name Expr or some other command to have the function contents (in text) be inserted into the new script for evaluation when pressing the data table script button.&lt;BR /&gt;I've tried many options with no luck, for instance wrapping the function definition in Expr(), and using Expr, Name Expr...&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; New Script( "Save Presentation All", 
		Eval Expr(Name Expr(toJournal));
		jj &amp;lt;&amp;lt; save presentation();
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;Any Help would be very much appreciated&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 15 Oct 2025 11:45:30 GMT</pubDate>
    <dc:creator>shuey</dc:creator>
    <dc:date>2025-10-15T11:45:30Z</dc:date>
    <item>
      <title>How to use Name Expr of functions inside dt &lt;&lt; New Script</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-Name-Expr-of-functions-inside-dt-lt-lt-New-Script/m-p/907784#M106603</link>
      <description>&lt;P&gt;I have a JSL script that has the following:&lt;BR /&gt;There is a function stored in a variable toJournal:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;toJournal = Function({},
     //some commands
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I want to call this function inside a New Script message:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; New Script&lt;/CODE&gt;("save presentation",&lt;BR /&gt;toJournal();&lt;BR /&gt;journal &amp;lt;&amp;lt; save presentation();&lt;BR /&gt;);&lt;/PRE&gt;
&lt;P&gt;however due to name scope where I use names default to here(1) in my main script, the function toJournal isn't known when running the save presentation script button in the Data Table.&lt;BR /&gt;&lt;BR /&gt;I would like to use Name Expr or some other command to have the function contents (in text) be inserted into the new script for evaluation when pressing the data table script button.&lt;BR /&gt;I've tried many options with no luck, for instance wrapping the function definition in Expr(), and using Expr, Name Expr...&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; New Script( "Save Presentation All", 
		Eval Expr(Name Expr(toJournal));
		jj &amp;lt;&amp;lt; save presentation();
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;Any Help would be very much appreciated&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Oct 2025 11:45:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-Name-Expr-of-functions-inside-dt-lt-lt-New-Script/m-p/907784#M106603</guid>
      <dc:creator>shuey</dc:creator>
      <dc:date>2025-10-15T11:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Name Expr of functions inside dt &lt;&lt; New Script</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-Name-Expr-of-functions-inside-dt-lt-lt-New-Script/m-p/907795#M106604</link>
      <description>&lt;P&gt;Try it this way.&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 = Data Table( "Big Class" );
toJournal = Function( {},
	Print( "Hello, world!" )
);
Eval( Eval Expr( dt &amp;lt;&amp;lt; New Script( "Guess What", Expr( Name Expr( toJournal() ) ) ) ) );&lt;/CODE&gt;&lt;/PRE&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="mmarchandFSLR_0-1760529981442.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/85124i928120264014CAD6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mmarchandFSLR_0-1760529981442.png" alt="mmarchandFSLR_0-1760529981442.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Oct 2025 12:06:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-Name-Expr-of-functions-inside-dt-lt-lt-New-Script/m-p/907795#M106604</guid>
      <dc:creator>mmarchandFSLR</dc:creator>
      <dc:date>2025-10-15T12:06:30Z</dc:date>
    </item>
  </channel>
</rss>

