I am looking for the code to determine the event that fired off a script. Are there any methods to check to see if the event is post-read, pre-write, post write, pre delete, or post delete?
I am looking for the code to determine the event that fired off a script. Are there any methods to check to see if the event is post-read, pre-write, post write, pre delete, or post delete?
If there is, it would be a member of the oScript object, I would think (check the help file).
Another way to do it is create individual scripts for each event type that call a common function[1]. Have the individual scripts pass the function type and any objects needed to the common script like this:
' table post read script
With CreateObject("Scripting.FileSystemObject")javascript:void(0);
executeGlobal .openTextFile("common.vbs").readAll()
End With
commonFunction ("table post-read", oScript, oSession, oBusObj)
[1]: stackoverflow.com/.../1976323 (note: the code in user-defined scripts is automatically put into a Sub already, so you can't define a new Sub in user-defined scripts).
*Community Hub is the new name for Sage City