Jump to content
Macro Express Forums

rberq

Members
  • Posts

    1,195
  • Joined

  • Last visited

  • Days Won

    61

Everything posted by rberq

  1. Can the applications be started with commands entered in the Start | Run box? If so, put the individual commands in a .bat file, and run the file. For example, the first command below will start Internet Explorer and open the web page for this forum topic. The second command will start another copy of IE and open the Google search page. The third command will start Notepad. start iexplore "http://pgmacros.invisionzone.com/index.php?showtopic=4371" start iexplore "www.google.com" start notepad When you have put all the individual startup commands in a .bat file, then make a desktop shortcut to run the batch file, or double-click the batch file name in a folder, or enter it in the Start | Run box. You don't need Macro Express to do it, but you could write a macro command like "Program Launch xxx.bat" to run the list of commands.
  2. Is it possible for you to print out the macro script itself, and post that here? Once we see how the script is written, it should be easy to advise you.
  3. Does your script command look like this? For example, for Control-c (copy to clipboard): Text Type: <CTRLD>c<CTRLU> Where do you put the delay? If you think the macro is feeding the keystrokes faster than the application can accept them, then try preceding your Text Type command with something like: Keystroke Speed: 30 Milliseconds
  4. Yes, I have always thought that inside a .exe file is a strange place to store icons. Next time Bill Gates visits I'll ask him whose idea that was.
  5. Once you have browsed to the folder, double-click on either macexp.exe or macedit.exe. The icons should then appear.
  6. I always do the (SHIFT / ALT / CNTRL) DOWN separate from the UP. I have the perception, rightly or wrongly, that separate commands are more reliable across a variety of PCs. For what it's worth, I recently had to change a macro from using MOUSE LEFT CLICK, to using MOUSE LEFT BUTTON DOWN followed by MOUSE LEFT BUTTON UP, with keystroke delay of 30ms. For some reason, with the particular application the macro interacts with, the separate operations were much more reliable.
  7. A DOS batch file can set a return code, for example EXIT 5 which can be tested within DOS like so: IF ERRORLEVEL .... If I launch a DOS batch file from ME, can I get the return code directly into a variable? For example something like this, which I have tried and it doesn't seem to work: Variable Set String from Environment Variable [ERRORLEVEL] How about the return code from a Windows program?
  8. That's an clever approach, John. It will be interesting to see whether the AutoIT script runs fast enough to be practical. One thing you might think about: I have noticed that some Web page renderings, even though they are "identical" from one day to the next, seem to be off by a pixel here and there, at the boundaries between two colors. If true, this makes your absolute reliance on the corner pixels a weak point. I wonder how it would work if you chose random pixels to match, rather than specific (corner) ones. The random sample could be chosen either when developing the original map, or at search time. Probably it's more efficient to choose the sample only once, when developing the original map. Then when searching you would not require 100 percent matches between map and screen -- to allow for the "expected" tiny differences from day to day in screen formatting. Probably matching 90 to 98 percent of the pixels would be enough to make the identification.
  9. No, it is related, but not the same at all. With a pixel map, you can look at a spot (or many spots) and see whether what is there is what you expected to be there. That's kind of the opposite of knowing that what you want is (or may be) somewhere on the screen, but you don't know where. Granted, you could write a macro that prompts you to select two opposite corners of a rectangular area, then saves a pixel map of the rectangle at whatever resolution you choose. That is easy. Then, in theory at least, another macro could scan a screen matching the original pixel map against every same-sized rectangle to see if the map matches a section of the screen. But my PC is not a Cray-15 or an IBM Sequoia. As a practical matter, the matching has to be done by a fast, pre-compiled program. A run-time-interpreted script like Macro Express is orders of magnitude too slow to do the task in a reasonable time.
  10. ME does with the keyboard and mouse pretty much all that I can do with them. What ME does not do well, is what I can do with my eyes. For example, there are many forum questions about how to locate a control on a screen, when the control is not of the type where “GET CONTROL” or “CAPTURE CONTROL” will work. This is especially a problem with web forms, where the browser may format the screen somewhat unpredictably. I’d love to see a Macro Express scanning feature to simulate what we easily do by sight. This would consist of a “Capture Image Fragment” command, where you would mouse-outline a piece of the screen, and ME would save the bitmap or pixel map of the outlined area. Then at run time, there would be an equivalent “Find Image Fragment” to scan the screen and return the x- and y-coordinates of the fragment. Then you would simply move your mouse to the coordinates, click to get the text cursor there for typing, double-click if appropriate, and so on. When I searched the Internet, I found “Macro Scheduler”, sold by mjtnet. It has an Image Recognition feature that does this pretty well. Macro Scheduler can create executables that will run on any PC without the base product being installed. I am tempted to buy a copy for image recognition alone. It could be used from ME by running the executables with the Launch Program command. But it would be a lot easier to have an integrated ME feature. Does anyone know of a similar independent product that could be used with ME?
  11. Ditto everything Cory said. Microsoft has spent millions developing .NET, including powerful and pretty-simple forms development, and it's easy to integrate the forms with ME. It's going to be very hard for you to make anything nearly that powerful. And when you do, because it is oriented to ME, you will sell the software by the dozens or hundreds at best. Sophisticated PC software can be sold for 50 or 100 bucks a copy because it is sold by the tens or hundreds of thousands of copies. ME-based forms development might be a good hobby, but you probably won't retire on the profits.
  12. Good discovery. Thanks for passing that along. I'm sure it will come in handy one day, if only I can remember it until that day comes.
  13. One approach is to have a separate "learning" macro, where you prompt the user to navigate manually through the screens. At each point where the screen is to be clicked, have the user put the mouse in the right place (without clicking) and press the ENTER key or some other key. The macro does a WAIT FOR KEY PRESS and when the user presses the key, you get the mouse coordinates and save them to a file. The user only has to go through this process once, and when he is done you have saved coordinates unique to his screen resolution, his version of IE, and so on. You can get as fancy as you want with this. For example, the learning macro could store pixel colors for key locations, and check them each time the "real" macro runs. That way you can detect whether the user has changed his IE settings, screen resolution, etc. and force him back to the learning macro if something has changed. It's also a good idea to force the IE window to some predetermined size (WINDOW RESIZE) in case the user shrinks it down or goes from smaller to full-screen or whatever.
  14. Good thought. I will check on that -- I know the restore-hooks command can be inserted in a macro, too.
  15. Thanks for the responses. Part of the problem turns out that the switches were mis-programmed, so the right-side Shift key, operated by the user, triggered the change from one PC to the other. Still no answer on why the <TAB> and <BACKSPACE> act strangely ... I suspect something else caused by the KDM (KVM?) switch, since I have replaced the offending <TAB> with a mouse click, and removed the <BACKSPACE> entirely, but IE still sometimes goes back to the prior web page. So ME is likely an innocent bystander here, not involved in any of the problems. But of course it gets blamed by the users because it's there....
  16. We just installed Macro Express on two PCs that use KDM switches (Keyboard / Display / Mouse switches). The user has one monitor, keyboard, and mouse, which are switched between the Macro Express PC and another unrelated PC. One macro, that has been running reliably on dozens of other PCs for many months, fails intermittently in this new environment. Keystrokes from the Text Type command are sometimes processed wrong. For example, <TAB> acts like <SHIFTD><TAB><SHIFTU> and jumps the view from the top to the bottom of the web page. Also, <BACKSPACE> typed in a data-entry field should erase the previously-typed character; instead it is passed to Internet Explorer and returns to the previously-displayed web page. One user said she was manually filling in another web form, and her monitor/kybd/mouse were switched to the other computer even though she did not invoke the switch. (There are timed macros that would have run and possibly would have resized the window she was working in.) Has anyone else see odd behavior with ME and KDM switches? Any idea what is going on?
  17. What is the penalty, in memory or otherwise, of creating a string array much larger than you ever would need? Any logic to process elements sequentially could be written simply to stop when an empty element is reached. Does the array take up significant space if values have not yet been assigned to the elements?
  18. The wording is certainly ambiguous. I think it means, you can write a Repeat loop to process an array, with number of repetitions specified in an integer variable like N[1]. So instead of coding REPEAT 100 TIMES you would code REPEAT N[1] TIMES. In your script, just before the REPEAT command you would get the number of elements into N[1]. Then, at a later date, if you redefine the array to allow for fewer or more elements, you don't have to change the processing logic, because you did not hard-code the number into the REPEAT command.
  19. The file-processing does happen in the background, without any window involvement, so you should be OK there. John told you how to write text files. Look at commands "Ascii File Begin / End Process" and "Text File Begin / End Process" for reading the files back in after they are written. As John mentioned, using INI files may be a better approach -- writing and reading is simpler, but the quantity of data you can store in one entry of an INI file is severely limited. You can also store strings in environment variables, which can be created on the fly -- see Variable Modify String and Variable Set String commands. The size of a string stored in an environment variable is also limited, but not as badly as INI values -- env variables follow Windows rules, I believe.
  20. Yes! I have seen the same thing, but I thought it was unique to the weird application I was working with. The other issue I ran into was, on an extra-fast computer, by the time Windows (or IE?) changed the mouse pointer shape, the pointer had zipped past the target and the click fell on dead space. Had to set Mouse Speed to a few milliseconds to slow it down a bit.
  21. If you are desperate enough, you could try opening the .mex file in a text editor, copy to clipboard what you think is your macro, create a new .mex, open that with the text editor, and paste in what you copied. Then try opening the new .mex with ME and see what you have. It's (barely) possible that you will come up with enough of your original to be useful. Or open a new macro in a new .mex with the direct editor and paste in what you copied, then switch to the script editor and see what is there. Probably a very low chance of success, but what do you have to lose?
  22. Do you know, in one dimension, where the button is? Here's a method I have used a number of times: Let's say you know the button is at coordinates 123,xxx -- that is you know its horizontal displacement but not its vertical displacement. You move the mouse to something like 123,100, then in a REPEAT loop you increment (or decrement) the y-coordinate a few pixels at a time to move the mouse down (or up) the screen. At each mouse step you do IF MOUSE CURSOR = INTERNET NAVIGATE to see if the cursor has changed to the hand with finger ready to click, meaning the mouse is now on the button. You can search right or left, up or down, or scan a rectangular area depending on how you increment or decrement the coordinates. The biggest problem with this technique is, there may be other objects on the page that will also turn the mouse cursor into the NAVIGATE format. If you run into one of those before you find the button, then you are out of luck, unless you get REALLY fancy and calculate the size of the found object by moving the mouse up-down-left-right, or if you can rely on a color or something else to see if you have the right object.
  23. It's not that easy. When a macro starts to run, all variables are cleared. To carry over a value you have to store the variable somewhere that will survive restarts of Macro Express and reboots of Windows. The most straightforward is probably an INI file. Build the INI file manually with a text editor. Then each time the macro runs Variable Set String [from INI file] Variable Modify String [convert to integer] Variable Modify Integer [increment] Variable Modify Integer [convert to string] Variable Modify String [save to INI file] You could store the string in the Windows registry. My preference (prejudice?) is to stay away from the registry. P.S. I just noticed you said you want to retain the count "during the session". In that case, you can store the string in an environment variable. The environment variable can be created on the fly with whatever name you choose to give it.
×
×
  • Create New...