         menu.addItem(openMenuItem)
         
         self.didChangeFolder = false
+    }
+    
+    
+    /// Dispatch an Apple event that notifies the given document was opened
+    ///
+    /// - parameter document: the document that was opened
+    func dispatchEvent(documentOpened document: Document) {
+        
+        let eventType = ScriptingEventType.documentOpened
+        let event = createEvent(by: document, eventID: eventType.eventID)
+        
+        guard let urls = self.scriptHandlersTable[eventType] else { return }
+        
+        self.dispatch(event, toHandlersAt: urls)
+    }
+    
+    
+    /// Dispatch an Apple event that notifies the given document was opened
+    ///
+    /// - parameter document: the document that was opened
+    func dispatchEvent(documentSaved document: Document) {
+        
+        let eventType = ScriptingEventType.documentSaved
+        let event = createEvent(by: document, eventID: eventType.eventID)
+        
+        guard let urls = self.scriptHandlersTable[eventType] else { return }
+        
+        self.dispatch(event, toHandlersAt: urls)
     }
     
     

    ///   - eventID: the event ID to be set in the returned event
    ///
    /// - returns: a descriptor for an Apple event by the `Document`
    func createEvent(by document: Document, eventID: AEEventID) -> NSAppleEventDescriptor {
        
        let event = NSAppleEventDescriptor(eventClass: AEEventClass(code: "cEd1"), eventID: eventID, targetDescriptor: nil, returnID: AEReturnID(kAutoGenerateReturnID), transactionID: AETransactionID(kAnyTransactionID))
        

    }
    
    
    /// load script info in Apple Script bundle
    private func loadScriptInfo(at url: URL) {
        
        let infoUrl = url.appendingPathComponent("Contents/Info.plist")
