Hello adepters,
I have a little AOM challenge, well for me it is!
In the instance.acl file, I call the following.vbs file
$temp = "" . doc_type_dir() . "\\" . "element_insert_trigger_v5.vbs""
source $temp
In the element_insert_trigger_v5.vbs file, I add the following event listeners:
Sub set_element_insert_listener()
Dim DOMDocument
Dim DOMRootNode
Dim DOMListener
Dim DOMclose_window_on_paste
Set DOMDocument = Application.activeDocument
Set DOMRootNode = DOMDocument.documentElement
' create an event listener instance
Set DOMListener = new element_insert_trigger_Class
Set DOMclose_window_on_paste = new close_window_on_paste_class
DOMRootNode.addEventListener "DOMNodeInserted", DOMListener, false
DOMRootNode.addEventListener "AOMPaste", DOMclose_window_on_paste, false
End Sub
set_element_insert_listener()
Now, what I want to do in acl code is to temporarily remove the event listener (specificaly the AOMPaste listener), manipulate tags in the document with acl and then reactivate the event listener.
I tried, with no success,in a seperate remove_element_insert_trigger_v5.vbs the following:
Sub remove_element_insert_listener()
Dim DOMDocument
Dim DOMRootNode
Set DOMDocument = Application.activeDocument
Set DOMRootNode = DOMDocument.documentElement
' create an event listener instance
' Here my assumption is that both "DOMListener" and "DOMclose_window_on_paste" can be removedbecause they
' are already set in memory with "element_insert_trigger_v5.vbs" from the "instance.acl" when openingthe document.
DOMRootNode.removeEventListener "DOMNodeInserted", DOMListener, false
DOMRootNode.removeEventListener "AOMPaste", DOMclose_window_on_paste, false
End Sub
remove_element_insert_listener()
First of all, is it possible todeactivate and reactivate event listeners and does my approach makes sense?
We use Epic 4.4k.
Thanks in advance
Sylvain Castonguay
Tech Pub Project Leader
BRP