David Tong Posted December 1, 2004 Report Share Posted December 1, 2004 Every few days I run a macro that: (1) Finds all doc files in My Documents (about 2000 in all) using the Windows Search window. (2) Selects everything in the results window and drags them into a pre-opened Powermarks window. This triggers Powermarks to make a link to each document, with each word in the filename stored as a keyword with the link. The result is that I can use Powermarks to retrieve any document instantly just by typing in the first few letters of one or more keywords. Most of the time Windows Search takes only a few seconds, but sometimes it can take nearly a minute. So it would be nice if the macro could sense when Search has finished. The trouble is, I can’t see how to achieve this and instead I have to insert a crude worst-case wait of about 45 seconds. I tried ‘Get Control %C1%’ on the search output window followed by ‘Wait for Control %C1% to become enabled’ but this has no effect. And ‘Wait for program to terminate’ seems inappropriate because Windows Search isn’t listed as a program. Can anyone suggest a way of detecting the end of a search automatically? Thanks, David Tong. Quote Link to comment Share on other sites More sharing options...
floyd Posted December 2, 2004 Report Share Posted December 2, 2004 One simple solution is to use the Get Pixel Color command. The Windows Explorer Search dialog has two buttons, Search Now and Stop Search. You can use this command to trap a pixel color at some point on the Search Now button, do the search, and then wait until the button is restored to its original color. This will work because the button is disabled during the search and is re-enabled afterwards. The steps: Move mouse over a point on the Search Now button Get Pixel Color at that position Use the Mouse Left Button Click command to start the search Inside an infinite loop ... Delay for a second or two Get the pixel color again ... continue looping until the color is correct Exit the loop Quote Link to comment Share on other sites More sharing options...
David Tong Posted December 2, 2004 Author Report Share Posted December 2, 2004 Floyd, Thanks for that nice bit of lateral thinking. It works a treat. David. 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.