Hi Andre,
U are right, closing an application with unsaved files is highly undesirable,
the way I wrote the script is that if the applications pops up the "save - yes,No,Cancel" , then the script terminates and does not close the application.
I'm currently testing the script without closing open applications, But I'm not sure that defragmenting a disk is safe enough with other application still active...
Cheers,
gilk