Jump to content
Macro Express Forums

rberq

Members
  • Posts

    1,200
  • Joined

  • Last visited

  • Days Won

    61

Everything posted by rberq

  1. The logic looks OK, but your second block of code has a discrepancy between color 215 and color 255. Which color are you really looking for? Could that be the problem? Repeat Until %N2% = 215 Get Pixel: Window Coords: 783, 651 into %N2% If Variable %N2% = 255 Mouse Left Button Click End If Repeat End Even after you fix that, it is possible that Windows will treat the two distinct mouse clicks as a double-click. 100ms delay might not be enough. Other than a longer delay, another way to avoid the double-click interpretation is to move the mouse to a second location for the second click. I know you want to click in the "same" place, but maybe moving it a few pixels one way or another will still qualify as the same. For example, if I manually position the mouse over a file name in Windows explorer, and run the following macro, it acts as a double-click and opens the file. However, if I have the macro move the mouse 10 pixels to the right prior to the second click, the two clicks are treated as two clicks and the file does not open, and the delay can be removed from the macro. Mouse Left Button Click Delay 100ms Mouse Left Button Click
  2. What is the title of the Not Found window? You can probably do the search, delay 1/2 second so the search has time to complete, then say IF WINDOW 'NOT FOUND' IS RUNNING ACTIVATE WINDOW 'NOT FOUND' TYPE 'ENTER' (assuming the OK button is the default) END IF
  3. rberq

    XOR

    XOR is the "exclusive OR", meaning one of the two conditions tested is true, but both conditions are not true. For example, the macro below will display the "False" text box. If you change one of the two Variable Set String commands, then it will display "True". Variable Set String %T1% "a" Variable Set String %T2% "a" // If Variable %T1% = "a" XOR If Variable %T2% = "a" Text Box Display: True Else Text Box Display: False End If Your macro as written is straight-forward and easy to understand. I don't think it can be changed to use XOR. And if you could, I don't think it would be easy to understand.
  4. The line highlighted by the debugger is the one about to be executed, not the one that was last executed. So you wouldn't see the variable change until the subsequent line is highlighted.
  5. As you have said, you can schedule a ME macro to do the hibernation. To awaken, use the Windows scheduled task feature. Just schedule some innocuous task like Notepad to start at the wake-up time. There is a check box within the scheduler (I had to search for it) that indicates "Wake the computer to run this task". I am told this will wake it from hibernation. Haven't tried it myself, so if you try it let us know the results.
  6. Yes, schedule it to play every x seconds, whatever interval suits your fancy. You can get to the scheduling either by right-clicking on the macro in Macro Explorer, or by going into the Scripting Editor. And yes, to make the toggle macro, the easiest way is to use the scripting editor. In Macro Explorer, click Macro in the menu bar, then Add Macro, then choose the hot key, then click the Scripting Editor button (upper right). You will find in the long run that the scripting editor is the best way to do almost all development. It has been years since I made even a rudimentary macro by recording keystrokes.
  7. It is probably easiest to do this with two macros rather than one, like so: Macro A will simply type the command ONCE and then exit. On the Properties tab for the macro schedule it to "Play Macro Indefinitely" every ten seconds. Also on the Properties tab, clear the "Active" check box to disable the macro. Even though it is scheduled to run every ten seconds, it won't run while disabled. Macro B should be initiated via the hotkey. It will toggle Macro A between the enabled / disabled state. It will be basically this: IF MACRO_A IS ENABLED DISABLE MACRO_A ELSE ENABLE MACRO_A END IF Use Options | Preferences | Scheduler to set the scheduler's time interval to 1 second. You don't have to set that small an interval, but larger intervals will provides less precision and Macro A won't run at exactly every 10 seconds.
  8. Remove the REPEAT and the DELAY from the macro, so it just does its stuff once each time it runs, and then exits (MACRO RETURN). Using the Properties tab of the scripting editor, set it to run once every 40 seconds. Change the second macro -- the one that currently sets the run/don't run variable -- to enable/disable the first macro (MACRO ENABLE or MACRO DISABLE). The variable used now will not be needed at all. During any period when the first macro is enabled, it will be run once every 40 seconds by the scheduler. During the 40-second intervals between runs, other macros will be free to run. P.S. Use Options | Preferences | Scheduler from the ME menu bar, to set the Timer Interval to 1 second -- or higher if you aren't too concerned about the 40-second interval being quite so precise.
  9. No, I didn't use Set Focus. Just Get Control Text Type | Send Text to Control <GETCONTROL2P:01:CALC.EXE:SciCalcCalculator001:1Edit><TEXTTYPECT:1:<HOME><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE>%T1%>
  10. Variable Modify String | Replace substring , with [nothing]
  11. I wonder if Google Earth detects that the arrow key is held down, or if it acts upon the many rapid keystrokes produced by typa-matic repetition. How about trying Text Type <SHIFTD><ALTD> Repeat x times Text Type <ARROW DOWN> Delay 30ms Repeat End Text Type <ALTU><SHIFTU>
  12. Clever. I was thinking to replace the spaces with Carriage Return / Line Feed, but apparently <ENTER> does the same thing.
  13. With "Text Type - Send Directly to Control", it sounds like it is sending the text just as if you first positioned the cursor at the beginning of the field, then did a standard Text Type command. Try appending a bunch of <DELETE> characters to the end of the text before you send it to the control, and see what happens. With luck it will insert your text ahead of what is already there, then delete the original text. Edit: I tested with the Windows Calculator. With "Text Type - Send Directly to Control", and my new data in T1, it works well sending <HOME><DELETE> .... <DELETE>%T1% to the control.
  14. When you write (append) %T12% to a file, it is the value of T12 that will go to the file, not the literal "%T12%".
  15. <REM2:text into clipboard><SPKEY:0030><TEXTTYPE:<CTRLD>a<CTRLU>><WAITPB><TEXTTYPE:<CTRLD>c<CTRLU>><WAITPB><IMSD:300><TEXTTYPE:<HOME>><WAITPB><REM2:clipboard into T1><TVAR2:01:03:><REM2:clear destination><TVAR2:02:01:><REM2:parse><REP3:08:000002:000001:0099:1:01:T99><IVAR2:01:13:1:status><IFVAR2:2:01:1:0><EXITREP><ENDIF><TMVAR2:11:01:00:001:N01:><TMVAR2:11:01:00:001:006:><IVAR2:02:13:1: ><TMVAR2:10:03:01:001:N02:><TMVAR2:08:02:03:000:000:><ENDREP><REM2:display parsed data><TBOX4:T:4:CenterCenter000278000200:000:T2 value parsed%T2%><REM2: ><REM2: >
  16. To single-thread the copy commands, you could write all the copy commands to a single .bat file rather than type them into a command window. Once the .bat file is built, launch it with ME.
  17. Yes, that would be easier if it is always 8 digits, but some of your examples were not 8. Here's something you could try: Once your number is at the beginning of the text string, try Variable Modify String Convert to Integer. It's really sloppy programming, but as I recall Macro Express will take the string of characters, until it finds a non-numeric, and convert it. Then Variable Modify Integer Convert to Text String to get it back to text.
  18. You're doing pretty well. But: Image 4 -- starting position should be Value 1, rather than N1. Image 5 -- starting position should be Value 1. Image 6 -- Looks good. Since you are searching for a single blank, you have to actually type a single blank into the Search Text -- since it is blank, I can't tell from the image whether it is there or not. Image 7 -- This is a tricky one, and I led you astray a little bit. You will need two instructions -- Variable Modify String copy part of T1 to T5, then Variable Modify String append T5 to the end of T2. Be careful not to get the "to" and the "from" backwards when you append.
  19. Some of the script editor commands, especially for setting and modifying variables, have a lot of options. And you have to click the right radio button before you see some of the sub-options. Sorry, I can't post images, but keep looking within the basic commands and you will find where to enter what you need.
  20. Once the data is in the clipboard, put it a variable like T1. Then: Variable Set String T2 = "" (empty) Repeat Start Variable Set Integer N1 to position of "status" in T1 If N1 = 0 Repeat Exit End If Variable Modify String Delete N1 characters from the beginning of T1 Variable Modify String Delete 7 more characters from the beginning of T1 (to get rid of "status ") Variable Set Integer N2 to position of first blank space in T1 Variable Modify String append N2 characters from the beginning of T1 to the end of T2 Repeat End When this repeat loop finishes, the numeric strings will be stacked in T2 with one blank space between each string (and after the final string).
  21. I agree the feature Strahan wants would be very useful. I put in a feature request for it about 6 months ago, tracking number [iSS8287]. There is a macro program with exactly that feature, called Macro Scheduler, sold by MJT Net Ltd. (in Merry Olde England, I think). It's true you can do a lot with ME by checking specific pixels, especially if you KNOW what window is to be loaded. But if any one of a dozen windows might potentially be loaded, all with the same window title, you end up building color maps of all of them, storing the maps in a file, and writing complicated (and slow) logic to read back the file and check many pixels per potential window. An image-recognition feature would be a lot easier.
  22. Very clever, Alan! I think the problem of finding the wrong icon, among similarly-named ones, can be resolved also by the technique of beginning to rename the found item: Repeat Start Text Type %target% // Incremental search for item on desktop Text Type <F2> // Windows keyboard command to rename an object Copy to clipboard Compare the copied name to %target% If equal exit from repeat loop else Text Type <ESC> // Cancel the rename operation End If Repeat End Mouse Move: To the Text Cursor Position Text Type <ESC> // Cancel the rename operation
  23. 1) yes, but slow if you are just scanning for a single pixel. 2) no -- look are the (much more expensive) program called "Macro Scheduler" which can do it easily. 3) depends what you mean by "find" -- find out if it exists? find its position on the screen? highlight it to edit it?
  24. I will respectfully disagree about ME Pro. I have found it all-around clumsier and less user-friendly than ME3.
×
×
  • Create New...