This can easily be accomplished by doing this:
code:
function OnEvent_Initialize(MessengerStart){
Debug.Trace('File In Use : '+_isFileInUse('\\\?\\c:\\doc1.doc'));
}
function _isFileInUse(_path){
var _hfile = Interop.Call('kernel32',
'CreateFileW',
_path,
0x80000000 /* GENERIC_READ */,
0, 0,
3 /* OPEN_EXISTING */,
0x80 /* FILE_ATTRIBUTE_NORMAL */,
0);
Interop.Call('kernel32', 'CloseHandle', _hfile);
return _hfile = -1 ? true : false;
}
With this code you can create a script that will replace the normal /sendfile command and you can check if the file is in use, if it is copy it to another location and send it from there. I would say though to copy it to the scripts directory under like /files then on Uninitialize or SignOut you delete all the files.