cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

Solve problems, and share tips and tricks with other JMP users.
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

Recommended Articles