if not self.dirpattern:
            try: 
                editor=win32ui.GetMainFrame().MDIGetActive()[0].GetEditorView()
                self.dirpattern=os.path.abspath(os.path.dirname(editor.GetDocument().GetPathName()))
            except (AttributeError,win32ui.error):