How does one capture a “Don’t Save” or “Save” response to the Standard Suite “close” dialog?
try
close front document saving ask
on error
return
end try
returns “error number -10000” if the user selects “Cancel”, so that case is handled.
However, subsequent code depends on whether “Don’t Save” or “Save” was selected.
Thanks
UPDATE
Using regulus’s answer and it’s workaround strategy, I prefaced the code above with
tell application "Finder" to set _modDateAfterSaveDialog to
modification date of (info for file _filename)
where the _filename was assigned earlier from application-specific AS code.
Analogous code and a test followed the “try”.
I really have no idea how to get it directly. I assume the command you are issuing is a specific application command, not a standard suite command because standard applescript doesn’t have a “front document”.
In any case, here’s a work-around idea that might work. When a file is saved its modification date changes. So you need to know the file of the front document. Then you just check the modification date of the file before and after you issue this command. If it changed then you know the file was saved.
Good luck.