acantor Posted December 20, 2011 Report Share Posted December 20, 2011 I have a macro that is designed to trigger every time an Internet Explorer window that contains certain text in the title bar opens. When I change the activation to "Window gains focus" instead of "Window is opened," the script seems to work reliably. When I switch to "Window is opened, "however, one of three things happen: 1. Nothing. The window is not recognized, even though the window title definitely contains the text, and no other window has this text in its title. 2. Everything. The window is recognized, and the script runs. (But not every time!) 3. Everything, but the process takes too long. The macro does not activate until the window has been open about ten seconds. I have tried many variations, but I am running out of ideas. For example, activate when a process starts running works, but it takes too long to activate. Any ideas on how this force this script to run instantly as the result of the creation of a window? (In this situation, "Window gains focus" is OK for testing, but not for real life.) Quote Link to comment Share on other sites More sharing options...
terrypin Posted December 20, 2011 Report Share Posted December 20, 2011 Can't offer the practical solution you seek, but FWIW I think there may be two distinct issues here. Both regularly cause exasperating problems for me. 1. Window title activation is unreliable. And for me at least this is both when used in a script or as an activation. I've reported it several times to Insight. And I've posted about it here often over the years. For example here So have others. Here's one by you, two and a half years ago, reporting that Insight had now fixed the bug 'Window title activation fails sporadically the first time a window appears'! 2. Inexplicably long delays in activation. For me this happens not just with the window activation methods, but hotkey and mouse event activations too. It's a rarer problem, and so far mainly affects just one of my regularly used applications. I posted about it recently here but had no feedback. That particular application, MovieEdit Pro, seems to be sort of 'ME Pro hostile'. And it hasn't always been like this. It's become so annoyingly resistant recently that I've renewed my attempts to write a few simple AutoHotkey scripts to replace the macros. The couple I've finished work immediately they're activated. Compared with 5-15 seconds for ME Pro to run. Erratically, of course. The delay always occurs if MovieEdit has been freshly started. It then sometimes triggers quickly. -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
acantor Posted December 21, 2011 Author Report Share Posted December 21, 2011 I wonder whether the slow-to-execute problem could be related, in part, to processor speed and RAM. I experience it less often on my "high end" home computer than on my slightly underpowered work computer. It would seem window activation is not quite right yet. (Did it work better in ME3?) Quote Link to comment Share on other sites More sharing options...
pferris Posted February 16, 2012 Report Share Posted February 16, 2012 Have you tried using the timing command "Wait For Window" - THEN add a fixed delay after it (I like ~ 200-250ms delays for instance, for what I do)? Just a thought. Quote Link to comment Share on other sites More sharing options...
paul Posted February 17, 2012 Report Share Posted February 17, 2012 Any ideas on how this force this script to run instantly as the result of the creation of a window? (In this situation, "Window gains focus" is OK for testing, but not for real life.) My best suggestion is to use AutoHotkey and make it responsible for recognizing window names and firing off the relevant MEP macro. Such AHK scripts would be really simple to write. Quote Link to comment Share on other sites More sharing options...
acantor Posted February 17, 2012 Author Report Share Posted February 17, 2012 My best suggestion is to use AutoHotkey and make it responsible for recognizing window names and firing off the relevant MEP macro. Such AHK scripts would be really simple to write. If AHK scripts recognize window titles, why not use AHK for everything? One of the things I like about MEP is the ease of creating macros activated by window titles. I am reasonably familiar with AHK, and tried developing AHK scripts triggered by window titles. I poured through the Help system, posted questions on the AHK forum, and still have no idea how to do it. Quote Link to comment Share on other sites More sharing options...
terrypin Posted February 17, 2012 Report Share Posted February 17, 2012 My best suggestion is to use AutoHotkey and make it responsible for recognizing window names and firing off the relevant MEP macro. Such AHK scripts would be really simple to write. Paul: I thought you were an AutoIt fan? Can't it do that? I haven't yet done much with AutoIt, but I do agree that its syntax looks easier than AHK's. I was therefore feeling some regret at going down the AHK route. But if there is an AutoIt issue with window identification and/or selective activation of scripts, then maybe I'll stay with AHK. -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
terrypin Posted February 17, 2012 Report Share Posted February 17, 2012 If AHK scripts recognize window titles, why not use AHK for everything? Alan: In my case the answer is simple: ease of use. Of course, that in turn is partly due to familiarity and long experience with ME Pro. But the main reason is its inherently simpler user interface. I have written a few short scripts in AHK (including windows recognition) when I hit some issue or other with ME Pro, but they've taken me a long time! -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
paul Posted February 18, 2012 Report Share Posted February 18, 2012 If AHK scripts recognize window titles, why not use AHK for everything? Ease of use is the main answer, plus AHK has a truly horrible, totally non-standard syntax. I am reasonably familiar with AHK, and tried developing AHK scripts triggered by window titles. I poured through the Help system, posted questions on the AHK forum, and still have no idea how to do it. I'm with you there! Quote Link to comment Share on other sites More sharing options...
paul Posted February 18, 2012 Report Share Posted February 18, 2012 Paul: I thought you were an AutoIt fan? Can't it do that? Actually, I'm starting to think it might be easier with AutoIt, and that it's not quite as easy as I'd thought with either offering! I'll take a more detailed look at this and see if I can come up with a useful approach. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.