Jump to content
Macro Express Forums

Cory

Members
  • Posts

    4,207
  • Joined

  • Last visited

  • Days Won

    61

Everything posted by Cory

  1. I recently found a really good way to do this so I added it to my webpage here.
  2. Reboot and retry. If that doesn't work start an incident with ISS. They are very good and quite quick. info@wintools.com. Also are you using the most recent version? Did you try searching the forums and knowledgebase at ISS? Knowledgebase
  3. After defining the GC you should use the "If Control Enabled" condition to do what you want. Without seeing your script and the application it's diffficult to give you any troubleshooting advice. And exactly what is it not doing?
  4. I can't tell you how but I have seen commands for this in VBA macros that grab the contents of the clipboard and stuff it in a variable. Another thought is that if the file you're working from could be named c:\temp.doc or something generic like that you could do a CTRL+S and then rename/move-copy the file with ME when it becomes ready.
  5. There is no graphic support that I know of in ME but you could use a program like IrfanView (irfanview.com) and open the graphic and choose to turn off all the toolbars and such with command line switches (found in the help file).
  6. Yes, use scheduled activation and set it to run every 5 minutes.
  7. This is why I avoid using mouse moves at all costs. They work fine on one system but vary greatly depending on user toolbars, resolution and all kinds of things. Try using controls, tabs or shortcut keys instead as they will work universally. But when I must do this I save the XY values in the registry. If the macro fires and gets to the point where the move/click needs to happen and there are no registry values for the position I ask the user to position the mouse over the button and hit enter. THen I save this to the registry for all time sake and move on with the macro.
  8. You do realize that "Program Launch" won't Launch until the macro is run, right?
  9. Now it's "Back to work"!
  10. Some of you may have known I live in Fallbrook California and I would like to let you know that I am still here and safe. We did not evacuate although we are in a mandatory evacuation area and things have settled down enough that I dug my hard drives out of the back of the truck and am getting back to work. Another great thing about working for yourself!
  11. Ah, I see. So your macro is entering some data every time it opens or is something else? I would use Window activation and save the count in the registry. Some folks are afraid of using the registry but it's super simple and is more beneficial IMHO. Alternatively you could save the value in a file. So wen it launches it would read this value in and if less than 20 increment the count and write it back to the registry for next time ELSE clear the registry value and do whatever you want to do on the 20th appearance.
  12. Well don't get used to it, It's unusual that I am up at this hour on the west coast. :-) Stupid servers... To be honest I lost you there for what you are doing after the 19 windows but get that going first then if you still have questions ask again.
  13. I don't know of any way to do this in Windows but you could capture the screen with the PrintScreen, copy it to the clipboard, Clipboard Save Graphic to a file then use IrfanView with a crop command line parameter to create such a file then compare. But this is work. Have you tried using the Get Pixel Color? I’ve done screen area evaluations before this way by plowing thru an area of pixels on the screen to see if a pattern matches. Use nested repeats incrementing integers that will change which pixel to evaluate and compare the resultant list to a presaved file. It works and it’s not as complex as it sounds. Also if you’re looking to see if a field is blank you can simply plow thru it looking to see if any pixels do not equal white. Also if you’re looking to evaluate a field that doesn’t vary too much, EG either it’s all white or it has the Word “OK” in it, you can find one pixel where the black of the text appear and test that. But this requires that it always be nearly the same. There is another piece of software like ME out there I came across the other day that does something called HayStacking. http://www.mjtnet.com/demos/irdemo.html This looks for patterns in blocks of graphics just as you described. I have not checked it out yet but it looks promising, you might want to check it out.
  14. To answer your questions directly… This is impossible as stated. If you use the macro activation of Window Title it will run whenever there is a window present that matches the condition. However one could have a macro that fires periodically and counts the number of windows as I described before and abort if the number of windows are insufficient. Not sure I follow but in my example I use the Macro Stop command to cease the macro execution when the conditions were not right. Is this what you were asking?
  15. I’m not sure I follow all of your explanation and I don’t have a lot of time this morning but I’ll toss out a couple. From your explanation I gather that you want to do something when more than 19 of a “Captcha Challenge” appear. From what I see your first section will not accomplish this. By simply repeating 19 times and including an IF condition will not count the windows. If only one window matching the title exists the condition will be satisfied 19 times in milliseconds. I think you would rather do something like this: Repeat with Windows: Place title in %T1% If Variable %T1% = "Captcha Challenge" Variable Modify Integer: Inc (%N1%) End If Repeat End If Variable %N1% < 20 Macro Stop End If This repeat will go thru every open window, test to see if it matches, and count those that match. This happens instantly. Then if the count is less than 20 it will abort the macro. If I have time I'll write more in a bit.
  16. There are a couple of approaches. I usually will copy the entire page contents to the clipboard, read it into a variable, and parse out the chunks by finding markers like “To:”. If this sounds to intimidating you can tab thru the page and assuming they are al in fields you can grab the text. Or you can use the CTRL+F method and Tab > Shift+Tab. But if they are not in fields the easiest way was the first idea I mentioned. I was assuming that you are using a web based email. If not you can look at using controls to grab fields. I have a macro that disposes of email in Outlook to a file server and it grabs the date, subject and other info to create the file name.
  17. CyberChief: Generally if the window titles are different and change I will use the Wait For Window titles but often they either don’t change or appear before the contents of the window has loaded. Terminal emulators are a good example. The title is always the same and if you fire one up to do something the window pops up and depending on network traffic, astrological alignment, and the Coriolis effect the actual content could take from 20mS to a coffee break to load and what loads has a fair chance of being an error. This is when I like to use screen polling. But I use your approach often if there’s a chance a window won’t appear since there is no error handling in ME yet. It’s a solid approach.
  18. I wrote a subroutine to do something similar, you can get it at my my webpage. In a paperless project I'm involved in it's often possible that the automated filing and naming system will generate the same file name multiple times. This just appends them with an integer to make them unique by actually looking at the target folder to see if the intended file name exists over and over again until unique. Another simpler approach is to name or append the name of the file with a date stamp. Something like 20071011-083416 where you actually drill down to the second. This will guarantee uniqueness. Just use the Date/Time command under text to generate a string var.
  19. In cases like these where a simple Wait for Web Page will not work I use polling. That is I poll, or capture, the screen and test it before doing anything else. The easiest way is to do a CTRL+A which selects the entire screen and copy that to the clipboard where you can do the If Variable Contains test to see if it contains the string “did not load in the specified time”. You can also do SaveAs or View Source for polling tests. I was once harvesting a Yahoo Group where I was launching the message ID number in the URL. But every once in a while I would get one of those annoying advertising pages before reaching my intended target. I would simply poll the screen when it was done and if it didn’t contain the text “Message: %T1%” I would launch it again until it worked for a maximum of 5 times after which it would log an error and email it to me. Also you can use screen polls as a sort of Wait For in web pages. Just do it ever couple of seconds in a repeat until you get what you’re looking for.
  20. Naw, they stay the same on the console session. And I almost never need to use a mouse move or click with my macros. There's almost always a way to do it with the keystroke or control.
  21. C1 (that's a one) are control variables. The use of controls is a littl more advanced but well worth the study. Check out the tutorials in the sample file or on the website. They're pretty fun.
  22. Another thing... In cases like this I do not actually open the file. What I do is to load the file into a text var and use Get Position to find the integer position of the search text. Then I offset it and Copy Part of Text to set my variable. It's super fast, doesn't have timing errors, and is way simpler than dealing with the GUI.
  23. I don't have a lot of time to consider your problem in great detail but I did a quick test in my UltraEdit. Apparently both the editor and the dialog box that reports "Search string not found" are titled the same, in my case "UltraEdit-32". This being the case if the error box didn't appear then the editor would be on top but it too has the same name. Had the dialog box title been "UltraEdit-32 Error" this approach would work but in this case, no. If it were me I would use the error message as a control. SO set Ci to be the Error box string of text "Search string not found" using the text method. Now use a If Control Visible for your condition.
  24. Yes but with distributed macros this does not always work so I try to avoid GPC. You see depending on color depth on the playing computer, skins and other things one can run into pixels with different colors on different machines. These can be dealt with but it's more work. Mainly I feel that the proper way would be to have something like the Get Control Text that would return the state. Having said all this I found a better workaround and now think that this is actually a better approach all together. That is to go into the registry or INI file and get or change those settings there. For instance I was working in IrfanView and was going a batch process. There's an advanced settings dialog box and I needed to make sure everything was configured correctly. Problem is that's about 30 different check boxes and values. So by checking and changing the INI file I was able to enforce those settings instantly without even having to open the dialog box. Much smarter.
  25. I know my suggestions aren't the type of answer you're looking for but to be honest I'm stumped on how to switch between windows of identical names. Since you have several files in a play list my earlier suggestion won't work but most media players save play lists in a file and you can actually launch the PL instead of the MP3 file. So just like with my previous example but make it point to the PL instead of the MP3. But back to what you're specifically looking for it's a real problem. As far as I know ME can do things like getting list of processes and windows but if you command it to go to WinAmp it will always plow thru the list and open up the first one. So even if we could use a control that is distinctive we can't tell ME to go there. ALT+TAB as you pointed out even for a human so it's not going to be workable for ME. And I can't fault WinAMP either because generally media players are designed to run in only one instance. So I think you need to figure out how to make your setup work with one instance either from this suggestion or Kevin's.
×
×
  • Create New...