Skip to main content
Known Participant
Oct 15, 2024 1:39 PM UTC
Question

Cancel button in app.execMenuItem("SaveAs")

Hi my name is Alan,

 

I am creating a form with a save feature which is below,

 

app.execMenuItem("SaveAs");

 

I am wondering is there a way to tell if Save or Cancel is click in the dislog box.

 

As I would like to process the next stage of the form based on either button.

 

Thanks,

 

Alan

This topic is closed to new replies. Start a new post to keep the conversation going.

8 replies

try67
Community Expert
Community Expert
Oct 15, 2024 1:50 PM UTC

Not directly. However, you can know if the file has been saved after the dialog is closed, by checking the "dirty" property. If false, it means the file has been saved (or at least, that it wasn't edited after the last time it was saved). If true, it means it still needs saving (so most likely the user clicked Cancel in the Save As dialog).

Translate
alan_9073Author
Known Participant
Oct 15, 2024 1:52 PM UTC

Hi try67,

 

Thank you for the faster reply.

 

Howe would i check the as you call it "dirty" property.

 

Sorry if this is a stupid question.

 

Thanks,

 

Alan

Translate
alan_9073Author
Known Participant
Oct 15, 2024 2:11 PM UTC

Would i be correct with the following:

 

if (this.dirty) app.alert("File Not saved");

else {

    

}

 

Translate