I want to save and close all open windows in specific applications. I have found a easy way to do that in most apps, but MS Excel has a special behavior.
If I have 12 open windows in MS Excel, my normal script won’t work unless I repeat it many times as in this script:
tell application "System Events" to exists process "Excel" if result then repeat 5 times try with timeout of 5 seconds tell application "Excel" to close every window saving yes end timeout end try end repeat end if
Why does MS Excel need to repeat a statement that should do it all in one step ?
Thanks in advance.