cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
R2OKeefe
Level II

Error when Saving Project File

I keep getting an error when trying to save a project file that says:

Project has unsaved documents. All files in a project must be saved or closed before the project can be saved. at row 1629.

One of my tables has 1629 rows, but it is already saved in the script a few lines above. I even tried manually saving each file again, then tried running the JSL to save the project, and I get the same error again. The only files currently open in the project are the two data tables (dt and dt2), and the script I am running this from. Both "filepath" and "PrjTitle" are variables that get assigned based on user input from modal windows earlier in the script.

 

dt << Save As( "$PROJECT/"||char(dt<<GetName)||".jmp" );
dt2 << Save As( "$PROJECT/"||char(dt2<<GetName)||".jmp" );
Wait(0.5);
Project << Save as( filepath||PrjTitle||".jmpprj" );

 

I also tried Save instead of Save As, but got the same result.

dt << Save As( "$PROJECT/"||char(dt<<GetName)||".jmp" );
dt2 << Save As( "$PROJECT/"||char(dt2<<GetName)||".jmp" );
Wait(0.5);
Project << Save( filepath||PrjTitle||".jmpprj" );

 

 

My only theory right now is that it has something to do with me trying to save the files to the project itself, but I don't see anything on the forums, scripting guide, scripting index, etc that says anything about that being something that cannot be done. The only things I could find were statements that you cannot save a project using JSL if there are unsaved files in the project, like this one here near the bottom of the page:

Note: If you're saving a project with unsaved documents in JSL, the project doesn't close and you get a log message that the project has unsaved documents. All files in a project must be saved or closed before the project can be saved. However, if you interactively save a project with unsaved documents, you are prompted to save the documents.

Source: https://www.jmp.com/support/help/en/17.1/index.shtml#page/jmp/create-a-project-with-a-bookmarks-pane...  

 

 

Currently using JMP 16.2.0, in Windows 10.

2 ACCEPTED SOLUTIONS

Accepted Solutions

Re: Error when Saving Project File

Upgrading to 17.0 should make the issue go away. Enough people were having issues with the "you must save everything in the project before saving the project" rule that we switched it so that attempting to save a project automatically saves all the documents open in the project first.

 

(Incidentally, are you sure you're not using JMP 15.x not 16.x? Because I could have sworn the we made that change for JMP 16, which would mean the error message you're seeing shouldn't actually exist there)

View solution in original post

R2OKeefe
Level II

Re: Error when Saving Project File

I got v17.1 installed by our IT team this afternoon, and tested out my script. It ran without any issues, so whatever changes you made in v17 solved my issue. Thanks for the help on this!

View solution in original post

9 REPLIES 9

Re: Error when Saving Project File

Yes, this should be working. Nothing about saving the data tables to the project should cause the unsaved file warning to come up. It certainly sounds like one of those file is still in an unsaved state when the save project line runs.

This leaves two primary possibilities:

  1. One or both of the dt << save as() lines is encountering an error and failing to save the table.
  2. The JSL script itself has not been saved.

Have you tried running the script up to where it saves the files, then attempting to each of the data tables and the script, using the GUI, one at a time, to see if the save prompt comes up for any of them (indicating that it is still unsaved)?

R2OKeefe
Level II

Re: Error when Saving Project File

Yes, I when the script errored out at that point (it is the last few lines of a 700+ line script), I tried manually saving each data table, but neither one has the asterisk after the table name signifying that it is unsaved, and both have the save icon in the toolbar greyed out since they are both already saved. If I run the dt << Save() or dt2 << Save() lines individually, they both run without issue.

 

I just tried editing a field in dt so that it has unsaved changes (such that the tab for dt in the project says DataTableName1*) then run the dt << Save() line, and it seems to save fine and the asterisk goes away. Then when I run the Project << Save() line I still get the same error.

 

Even if I try to do File -> Save As and overwrite the original data table saves, then run the Project << Save() line, it still fails and gives the exact same error message.

Re: Error when Saving Project File

Definitely sounds like the data tables are saved (and thus not the issue here). Any chance it's the jsl script itself?

R2OKeefe
Level II

Re: Error when Saving Project File

it is possible, but seems unlikely. I literally copied the script exactly in my first post, no changes whatsoever. And this section of the script was unchanged from the older script I am modifying for this new data pull/ analysis. The variables all return values that look correct, so I am out of ideas. I may just need to live with manually saving the project. I am in the process of getting my IT dept to update me to v17 (newest one we are using at my company right now), so maybe that will fix the issue entirely (fingers crossed). Thanks for the replies.

Re: Error when Saving Project File

Upgrading to 17.0 should make the issue go away. Enough people were having issues with the "you must save everything in the project before saving the project" rule that we switched it so that attempting to save a project automatically saves all the documents open in the project first.

 

(Incidentally, are you sure you're not using JMP 15.x not 16.x? Because I could have sworn the we made that change for JMP 16, which would mean the error message you're seeing shouldn't actually exist there)

R2OKeefe
Level II

Re: Error when Saving Project File

This is definitely JMP 16, not 15. IT should be installing v17 later today, I will let you know if that fixes the issues.

R2OKeefe_0-1694110984899.png

 

Re: Error when Saving Project File

I checked the old source, and yeah, you could totally get that error in JMP 16. I'm the one who wrote that feature (and the removed it), so you'd think I'd remember, but it's been a while. (In retrospect, you were clearly using JMP >= 16, because $PROJECT (and the whole concept of saving a file to the project didn't exist in until then). But it's definitely gone in 17, so I'm still optimistic that that will fix your issue.

R2OKeefe
Level II

Re: Error when Saving Project File

I got v17.1 installed by our IT team this afternoon, and tested out my script. It ran without any issues, so whatever changes you made in v17 solved my issue. Thanks for the help on this!

Re: Error when Saving Project File

Good to hear. Thanks for the update.