cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
vishwasanj
Level V

Saving with filename

Hi,

 

How can i save with the filename attached to my .png graph? I want my script to take the filename of the graph I am opening and save it in the folder.

 <<save picture ("C:\...path..\ex1.png","png");  This is what I have right now.

Instead of ex1, is there a way to get the filename automatically?

 

1 ACCEPTED SOLUTION

Accepted Solutions
uday_guntupalli
Level VIII

Re: Saving with filename

I am not exactly sure what you mean by opening a png graph . However , you can do something like this :
FilesList = Files In Directory(Your File Path) ; // This should give you list of all the files in the directory
for(i = 1 , i <= N Items(FilesList) , i++,
FileName = FilesList[i];
) ;
Now you have in FileName , the name of the file which you can use to append to your destination while saving

Best
Uday
Best
Uday

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: Saving with filename

If you have opened your data table using the variable "dt" as the handle pointing to the data table, then you can get the name of the data table with the following:

 

     filename = dt << get name;

 

This, and all other items you can ask for from the data table is documented at:

     Help==>Scripting Index==>Data Table

Jim
uday_guntupalli
Level VIII

Re: Saving with filename

I am not exactly sure what you mean by opening a png graph . However , you can do something like this :
FilesList = Files In Directory(Your File Path) ; // This should give you list of all the files in the directory
for(i = 1 , i <= N Items(FilesList) , i++,
FileName = FilesList[i];
) ;
Now you have in FileName , the name of the file which you can use to append to your destination while saving

Best
Uday
Best
Uday