<?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: Usability of Projects via JSL in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Usability-of-Projects-via-JSL/m-p/519040#M74512</link>
    <description>&lt;P&gt;The easiest way to save things to the project contents in JSL is via the $PROJECT special directory, which can be used (similar to $SAMPLE_DATA, $DESKTOP, etc) in just about every JSL API that uses paths.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;$PROJECT is only defined inside of projects, so when creating a project via JSL it has to be inside of the Run Script() command:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;prj = New Project(
	Run Script(
		dt = new Table("My table");
		dt &amp;lt;&amp;lt; Save As("$PROJECT/my table.jmp");
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open("$SAMPLE_DATA/Big Class.jmp");
w = dt &amp;lt;&amp;lt; Run Script("Bivariate");

prj = New Project();

Move to Project( destination( prj ), windows( {dt, w} ) );

prj &amp;lt;&amp;lt; Run Script(
	Create Directory("$PROJECT/my folder");
	Data Table("Big Class") &amp;lt;&amp;lt; Save As("$PROJECT/my folder/Big Class.jmp");
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or even:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;prj = New Project();

prj &amp;lt;&amp;lt; Run Script(
	Copy File("$SAMPLE_DATA/Big Class.jmp", "$PROJECT/data/Big Class.jmp");
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope that helps!&lt;/P&gt;
&lt;P&gt;Aa&lt;/P&gt;</description>
    <pubDate>Fri, 08 Jul 2022 12:16:55 GMT</pubDate>
    <dc:creator>aaron_andersen</dc:creator>
    <dc:date>2022-07-08T12:16:55Z</dc:date>
    <item>
      <title>Usability of Projects via JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Usability-of-Projects-via-JSL/m-p/519000#M74510</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;I have several jsl scripts dealing with data fetching from databases, "manipulation" and analysis of these with regards to different tasks.&lt;BR /&gt;For organization purpose I like to use "Projects" as all data tables and graphs and journals etc. can be stored in "one" file.&lt;BR /&gt;However, I struggle with the automation of the save procedure of the respective contents.&lt;BR /&gt;All files are stored under "Workspace". This is not actually stored in the project (which would need the files to be stored under "Contents").&lt;BR /&gt;I could not find a way that my script automatically stores the files under "Contents" or in later step be moved there.&lt;/P&gt;&lt;P&gt;My basic JSL code (using JMP16) looks like:&lt;/P&gt;&lt;P&gt;1. Version&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;project = New Project();
project &amp;lt;&amp;lt; Set Window Title( " blahblah " );
Move to Project( destination( project ), windows( {dt1, dt2, dt3} ) );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;2. Version&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;prj = New Project(
	run script(
...
)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Actually, both will end up with the same result all files (data tables and graphs) are under Workspace and I need to save them manually under Contents within this Project.&lt;/P&gt;&lt;P&gt;Any support / tips for data handling in Projects would be greatly appreciated!&lt;BR /&gt;I discussed the matter also with Martin and he proposed to use your knowledge / experience!&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2742"&gt;@martindemel&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 17:03:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Usability-of-Projects-via-JSL/m-p/519000#M74510</guid>
      <dc:creator>RobertB</dc:creator>
      <dc:date>2023-06-09T17:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: Usability of Projects via JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Usability-of-Projects-via-JSL/m-p/519040#M74512</link>
      <description>&lt;P&gt;The easiest way to save things to the project contents in JSL is via the $PROJECT special directory, which can be used (similar to $SAMPLE_DATA, $DESKTOP, etc) in just about every JSL API that uses paths.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;$PROJECT is only defined inside of projects, so when creating a project via JSL it has to be inside of the Run Script() command:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;prj = New Project(
	Run Script(
		dt = new Table("My table");
		dt &amp;lt;&amp;lt; Save As("$PROJECT/my table.jmp");
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open("$SAMPLE_DATA/Big Class.jmp");
w = dt &amp;lt;&amp;lt; Run Script("Bivariate");

prj = New Project();

Move to Project( destination( prj ), windows( {dt, w} ) );

prj &amp;lt;&amp;lt; Run Script(
	Create Directory("$PROJECT/my folder");
	Data Table("Big Class") &amp;lt;&amp;lt; Save As("$PROJECT/my folder/Big Class.jmp");
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or even:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;prj = New Project();

prj &amp;lt;&amp;lt; Run Script(
	Copy File("$SAMPLE_DATA/Big Class.jmp", "$PROJECT/data/Big Class.jmp");
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope that helps!&lt;/P&gt;
&lt;P&gt;Aa&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 12:16:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Usability-of-Projects-via-JSL/m-p/519040#M74512</guid>
      <dc:creator>aaron_andersen</dc:creator>
      <dc:date>2022-07-08T12:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: Usability of Projects via JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Usability-of-Projects-via-JSL/m-p/519116#M74521</link>
      <description>&lt;P&gt;Hi Aaron,&lt;/P&gt;&lt;P&gt;that helps a lot for data tables!&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;However, I also have a Journal which I would like to save under Contents (manually no problem but I want JSL to do it for me ...).&lt;/P&gt;&lt;P&gt;It seems not to work for Journals?&lt;BR /&gt;Is your suggested approach only working for data tables? (probably I am missing something...)&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Initialization
Names Default To Here( 1 );

dt = Open("$SAMPLE_DATA/Big Class.jmp");
w = dt &amp;lt;&amp;lt; Run Script("Bivariate");
obj = w &amp;lt;&amp;lt; Journal;
jrn = Current Journal();
jrn &amp;lt;&amp;lt; Set Window Title( "Journal" );

prj = New Project();

Move to Project( destination( prj ), windows( {dt, w, jrn} ) );

prj &amp;lt;&amp;lt; Run Script(
	Create Directory("$PROJECT/my folder");
	Data Table("Big Class") &amp;lt;&amp;lt; Save As("$PROJECT/my folder/Big Class.jmp");
	Current Journal() &amp;lt;&amp;lt; Save As("$PROJECT/my folder/Journal.jrn");	
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 14:33:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Usability-of-Projects-via-JSL/m-p/519116#M74521</guid>
      <dc:creator>RobertB</dc:creator>
      <dc:date>2022-07-08T14:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: Usability of Projects via JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Usability-of-Projects-via-JSL/m-p/519119#M74522</link>
      <description>&lt;P&gt;Found it myself ...&lt;BR /&gt;Journals need to be saved like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;obj &amp;lt;&amp;lt; SaveJournal("PATH");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks!&lt;BR /&gt;Robert&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 14:37:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Usability-of-Projects-via-JSL/m-p/519119#M74522</guid>
      <dc:creator>RobertB</dc:creator>
      <dc:date>2022-07-08T14:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: Usability of Projects via JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Usability-of-Projects-via-JSL/m-p/519619#M74562</link>
      <description>&lt;P&gt;Glad you got it working!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;As for Journals not accepting &amp;lt;&amp;lt; Save As(), that's the kind of thing I'd consider a bug in JSL. Any time the really obvious syntax doesn't work, even if some other less obvious one does, let JMP tech support know about it. They'll file a bug with your comments and forward it on to the appropriate JMP developer. While I can't make specific promises, we prioritize customer-reported issues highly, so there's a good chance we can get it fixed by the next release.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Aa&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2022 11:52:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Usability-of-Projects-via-JSL/m-p/519619#M74562</guid>
      <dc:creator>aaron_andersen</dc:creator>
      <dc:date>2022-07-11T11:52:31Z</dc:date>
    </item>
  </channel>
</rss>

