<?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 Saving PNG to created directory in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Saving-PNG-to-created-directory/m-p/822250#M100177</link>
    <description>&lt;P&gt;I would like to save "pngs" into my created directory. When I run the script the directory folder is made but the PNGs aren't saved because I'm not sure how to word the pathing. What syntax should I use?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;baseDir = "C:\temp\";
dir = baseDir || Substitute(MDYHMS(Today()), "/", "-", ":", ".");

CreateDirectory(dir);

gb=Graph Builder(
	Size( 876, 598 ),
	Show Control Panel( 0 ),
	Variables(
		X( :site ),
		Y( :VBD ),
		Group X( :wfr, Size( 57 ) ),
		Group Y( :size ),
		Color( :size )
	),
	Elements( Points( X, Y, Legend( 22 ) ) ),
	Local Data Filter(
		Close Outline( 1 ),
		Add Filter(
			columns( :size, :metal ),
			Where( :size == {"861.0x0.18", "863.5x0.18", "1014.0x0.144"} ),
			Where( :metal == {"M1", "M2", "M3"} ),
			Display( :size, N Items( 6 ) )
		)
	),
	SendToReport(
		Dispatch( {}, "", ScaleBox,
			{Min( -0.119090909090909 ), Max( 5.12090909090909 ), Inc( 1 ),
			Minor Ticks( 1 )}
		),
		Dispatch( {}, "400", ScaleBox,
			{Legend Model(
				22,
				Level Name( 0, "Metal 2- 861.0x0.18", Item ID( "861.0x0.18", 1 ) ),
				Level Name( 1, "Metal 3- 863.5x0.18", Item ID( "863.5x0.18", 1 ) ),
				Level Name(
					2,
					"Metal 1- 1014.0x0.144",
					Item ID( "1014.0x0.144", 1 )
				)
			)}
		),
		Dispatch( {}, "graph title", TextEditBox, {Set Text( "Vbd - Narrow" )} ),
		Dispatch( {}, "X title", TextEditBox, {Set Text( "Site" )} ),
		Dispatch( {}, "Y title", TextEditBox, {Set Text( "Volts" )} ),
		Dispatch( {}, "400", LegendBox, {Set Title( "Metals" )} )
	)
);
	
	report(gb)&amp;lt;&amp;lt;save picture( dir || "Vbd-Wide.png", "png" );&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 12 Dec 2024 17:21:33 GMT</pubDate>
    <dc:creator>CoxPorcupine721</dc:creator>
    <dc:date>2024-12-12T17:21:33Z</dc:date>
    <item>
      <title>Saving PNG to created directory</title>
      <link>https://community.jmp.com/t5/Discussions/Saving-PNG-to-created-directory/m-p/822250#M100177</link>
      <description>&lt;P&gt;I would like to save "pngs" into my created directory. When I run the script the directory folder is made but the PNGs aren't saved because I'm not sure how to word the pathing. What syntax should I use?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;baseDir = "C:\temp\";
dir = baseDir || Substitute(MDYHMS(Today()), "/", "-", ":", ".");

CreateDirectory(dir);

gb=Graph Builder(
	Size( 876, 598 ),
	Show Control Panel( 0 ),
	Variables(
		X( :site ),
		Y( :VBD ),
		Group X( :wfr, Size( 57 ) ),
		Group Y( :size ),
		Color( :size )
	),
	Elements( Points( X, Y, Legend( 22 ) ) ),
	Local Data Filter(
		Close Outline( 1 ),
		Add Filter(
			columns( :size, :metal ),
			Where( :size == {"861.0x0.18", "863.5x0.18", "1014.0x0.144"} ),
			Where( :metal == {"M1", "M2", "M3"} ),
			Display( :size, N Items( 6 ) )
		)
	),
	SendToReport(
		Dispatch( {}, "", ScaleBox,
			{Min( -0.119090909090909 ), Max( 5.12090909090909 ), Inc( 1 ),
			Minor Ticks( 1 )}
		),
		Dispatch( {}, "400", ScaleBox,
			{Legend Model(
				22,
				Level Name( 0, "Metal 2- 861.0x0.18", Item ID( "861.0x0.18", 1 ) ),
				Level Name( 1, "Metal 3- 863.5x0.18", Item ID( "863.5x0.18", 1 ) ),
				Level Name(
					2,
					"Metal 1- 1014.0x0.144",
					Item ID( "1014.0x0.144", 1 )
				)
			)}
		),
		Dispatch( {}, "graph title", TextEditBox, {Set Text( "Vbd - Narrow" )} ),
		Dispatch( {}, "X title", TextEditBox, {Set Text( "Site" )} ),
		Dispatch( {}, "Y title", TextEditBox, {Set Text( "Volts" )} ),
		Dispatch( {}, "400", LegendBox, {Set Title( "Metals" )} )
	)
);
	
	report(gb)&amp;lt;&amp;lt;save picture( dir || "Vbd-Wide.png", "png" );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Dec 2024 17:21:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Saving-PNG-to-created-directory/m-p/822250#M100177</guid>
      <dc:creator>CoxPorcupine721</dc:creator>
      <dc:date>2024-12-12T17:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: Saving PNG to created directory</title>
      <link>https://community.jmp.com/t5/Discussions/Saving-PNG-to-created-directory/m-p/822260#M100178</link>
      <description>&lt;P&gt;The path you are specifying is incorrect.&lt;/P&gt;
&lt;PRE&gt;"C:\temp\12-12-2024 12.04.31 PMVbd-Wide.png"&lt;/PRE&gt;
&lt;P&gt;It contains blanks and there is not a "\" between the directory path and the file name&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 18:07:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Saving-PNG-to-created-directory/m-p/822260#M100178</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-12-12T18:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: Saving PNG to created directory</title>
      <link>https://community.jmp.com/t5/Discussions/Saving-PNG-to-created-directory/m-p/822302#M100184</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also found a different solution by replacing last line with this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;filePath = dir || "\Vbd-Wide.png";
gb &amp;lt;&amp;lt; Save Picture(filePath, "png");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 18:36:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Saving-PNG-to-created-directory/m-p/822302#M100184</guid>
      <dc:creator>CoxPorcupine721</dc:creator>
      <dc:date>2024-12-12T18:36:43Z</dc:date>
    </item>
  </channel>
</rss>

