cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar

Fail to save picture in jsl

Hi everybody,

 

I am trying to script some codes to save all my plots as pictures. 

 

gb << Save Picture( "D:\Document\Variability\" || colList[i] ||".jpg", JPEG );

 

But I noticed that on those graphs with the header name with "/" in between the name (parameter name like "Win_A/FRP_Thickness"), JMP will prompt an error to tell me that the figures failed to save as pictures in my folder and the whole operation would then be aborted. 

 

Could I seek advice on how should I improve this ?

 

Thank you...  

 

1 ACCEPTED SOLUTION

Accepted Solutions
David_Burnham
Super User (Alumni)

Re: Fail to save picture in jsl

First note that JMP doesn't mind whether your path specification uses forward or backward slashes.   Therefore you are specifying a path that looks like this:

 

 

D:\Document\Variability\Win_A\FRP_Thickness.jpg

 

which fails because Win_A is being interpreted as a folder and not as part of the name of the file.

Before doing the save you might want to create a friendly file name e.g.

 

cname = Substitute(colList[i],"\","_");
path = "D:\Document\Variability\"  || cname || ".jpg";
gb << Save Picture(path,JPEG);

 

-Dave

View solution in original post

2 REPLIES 2
David_Burnham
Super User (Alumni)

Re: Fail to save picture in jsl

First note that JMP doesn't mind whether your path specification uses forward or backward slashes.   Therefore you are specifying a path that looks like this:

 

 

D:\Document\Variability\Win_A\FRP_Thickness.jpg

 

which fails because Win_A is being interpreted as a folder and not as part of the name of the file.

Before doing the save you might want to create a friendly file name e.g.

 

cname = Substitute(colList[i],"\","_");
path = "D:\Document\Variability\"  || cname || ".jpg";
gb << Save Picture(path,JPEG);

 

-Dave

Re: Fail to save picture in jsl

Couldn't agree more ! Thanks for the suggestion, David