Choose Language Hide Translation Bar
Highlighted
newbie_4
New Contributor

How do I Print current date as image (jpeg file) and save on a network share drive

Hello,

I am creating bunch of variability plots in a for loop and saving each plot with a unique name using the code below. However, I want to either be able to 1) add a current time stamp (when script runs) to each of these plots or 2) instead of displaying date on each plot, just save a seperate jpeg file that just has date time stamp. Can anyone suggest how can I do that.

 

 

dt = Current Data Table();

dt << New Column( "OVER_UNDER", character, nominal, formula( :MEASURED LAYER || "_" || :UNDER LAYER ) );
overunder = Associative Array( dt:OVER_UNDER << Get Values ) << Get Keys;
Create Directory( "\\drive location\folder" );
For( i = 1, i <= N Items( overunder ), i++,
	win = New Window( "window",
		var = dt << Variability Chart(
			Y( :VALUE ),
			X( :ROUTE, :OPERATION, :PRODUCT, :ANALYTICAL_ENTITY, :DATA_COLLECTION_TIME ),
			Connect Cell Means( 1 ),
			Std Dev Chart( 0 ),
			Points Jittered( 1 ),
			AIAG Labels( 0 ),
			Where( :OVER_UNDER == overunder[i] ),
			By( :PARAMETER, :OVER_UNDER ),
			SendToReport(
				Dispatch(
					{"Variability Chart for VALUE"},
					"Variability Chart",
					FrameBox,
					{Row Legend(
						:Current Tool,
						Color( 1 ),
						Color Theme( "JMP Default" ),
						Marker( 0 ),
						Marker Theme( "" ),
						Continuous Scale( 0 ),
						Reverse Scale( 0 ),
						Excluded Rows( 0 )
					)}
				)
			)
		)
	);

	win << save picture( "\\share drive\folder\" || overunder[i] || "_SPC.jpeg", "jpeg" );
	win << close window;
);

 

0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
Craige_Hales
Staff (Retired)

Re: How do I Print current date as image (jpeg file) and save on a network share drive

tb = Text Box( Char( Format( Today(), "dd-mm-yyyy" ) ), <<setFontSize( 48 ) );
pic = tb << getpicture;
pic << saveImage( "$temp/dateString.png", "png" );


Open( "$temp/dateString.png" );

dateString.PNGa picture of today

Craige

View solution in original post

3 REPLIES 3
Craige_Hales
Staff (Retired)

Re: How do I Print current date as image (jpeg file) and save on a network share drive

tb = Text Box( Char( Format( Today(), "dd-mm-yyyy" ) ), <<setFontSize( 48 ) );
pic = tb << getpicture;
pic << saveImage( "$temp/dateString.png", "png" );


Open( "$temp/dateString.png" );

dateString.PNGa picture of today

Craige

View solution in original post

Craige_Hales
Staff (Retired)

Re: How do I Print current date as image (jpeg file) and save on a network share drive

Or this

DateTitle.PNGPreference for adding date to output

Craige
newbie_4
New Contributor

Re: How do I Print current date as image (jpeg file) and save on a network share drive

This works exactly the way I wanted. Thanks so much Craige_Hales. Appreciate your help !