Yes, I understand. Trust me, I have had avariable go out of scope from one line to the next, so, it is entirelypossible.
-----Original Message----- From: Chip Orange [mailto:[email protected]] Sent: Monday, November 02, 2009 7:40 PM To: [email protected] Subject: RE: getting error when trying to block msaa event thanks, but in this case I use msgbox to display properties of the process variable just one or two lines before I call blockEvent. It's possible I'm passing the wrong type of variable, or in the wrong order, or something, but it's not empty, that's the one thing I'm sure of. here's a simplified example using outlook (which you can change to anything): dim loWindows, goMPProcess Set loWindows = DesktopWindow.Children.FilterByTitle ("inbox", fmStartsWith, false) if loWindows.count > 0 then dim goNPWindow set goMPWindow = loWindows(1) set goMPProcess = goMPWindow.process if goMPProcess is nothing then speak "internal error: unable to get inbox process" else ' block all MSAA events from this process blockAllMSAAEvents goMPProcess end if else ' loWindows.count > 0 speak "internal error: unable to get inbox window" end if ' loWindows.count > 0 sub blockAllMSAAEvents (forProcess) ' tell window eyes to ignore all MSAA activity from a given process. dim i,x set x = msaaEventSource msgbox forprocess.moduleName for i = event_SYSTEM_SOUND to event_SYSTEM_MINIMIZEEND ' first group x.blockEvent i, forProcess next for i = event_CONSOLE_CARET to event_CONSOLE_END_APPLICATION ' second group x.blockEvent i, forProcess next for i = event_OBJECT_SHOW to event_OBJECT_CONTENTSCROLLED ' third and last group x.blockEvent i, forProcess next end sub
