Jump to content
Macro Express Forums

rberq

Members
  • Posts

    1,203
  • Joined

  • Last visited

  • Days Won

    61

Everything posted by rberq

  1. I haven't tested it, but you could try: (1) Text Type [PrintScreen] to get the screen shot into the clipboard, (2) Program Launch to start Paint or some other graphics application, (3) Text Type Ctrl-v to paste from the clipboard, (4) Text Type save commands to the graphics app, then commands to exit from the graphics app. Also there are screen-grabber applications that you probably could run via macro commands -- see commands for launching of programs.
  2. I tested with MacroExpress version 3, using the URL for this forum page, and running the macro successfully brought me right here: // Variable Set String %T1% "https://pgmacros.invisionzone.com/topic/8145-store-web-url-in-variable-and-launch-it/" Web Site: %T1% [Default Browser] //
  3. Variable Modify String [Trim] removes spaces, line breaks, carriage returns, and the like from left and right ends of the variable. You don't "tell" Trim what to trim, it just does it. See Macro Express "Help" screens for further explanation. If you want to see what is there, you could write your text variables to a text file, then look at the file with a hex editor if you have one. But start by just trying Trim and see if it helps.
  4. See Cory's first reply -- command "Repeat with Folder". Something like this: Variable Set Integer %N99% to 0 [counter] Repeat with Folder [each time through the loop, Macro Express puts the name of the "next" file into variable %T1% or whatever text variable you want to use] Variable Modify Integer: Inc (%N99%) [increment counter] If Variable %N99% > 61 [exit from loop after 61 file moves] Repeat Exit End If Move File or Files: "%T1%" [move one file] Repeat End Use the Macro Express Help screens to read about these commands.
  5. Once you have isolated T1, T2, etc., try Variable Modify String [Trim] on each text variable. I think that will do it. There's also a [Left Trim] and a [Right Trim] option.
  6. Have a look at these commands: Repeat with Windows: Place title in %T1% Variable Set String %T1% from Window Title If Window Title "Yahoo - login - Mozilla Firefox" is on top If Window Title "Yahoo - login - Mozilla Firefox" is running Many ME features dealing with window titles can check for partial strings or for exact matches.
  7. You can use Text Box Display, with the remaining time displayed as a variable. Something like this: // Variable Set String %T1% "4:58" Text Box Display: %T1% Delay 700 Milliseconds Text Box Close: %T1% // You may have trouble getting it display as often as once per second, simply due to the timing within ME. As far as I know, you can't change the value within an already-displayed text box, so it has to be closed and a new box displayed for each time change.
  8. ? I have been using ME for years and I still stumble onto hidden stuff like that.
  9. Variable Set Integer has options to load current hour or minute or second into variables. Also experiment with the Date and Date/Time commands.
  10. This logic waits for up to approximately 20 seconds (200 tenths). As soon as screen colors match the expected values, it exits from the REPEAT loop. If colors do not match within 200 iterations, it also falls through the REPEAT END to whatever instructions follow. // wait 20 seconds for switch to password screen (monitor for change from blue to white, and for Submit button (gray)) Repeat Start (Repeat 200 times) Get Pixel: Screen Coords: 600,565 into %N1% Get Pixel: Screen Coords: 268,466 into %N2% If Variable %N1% = 16777215 AND If Variable %N2% = 13160660 Repeat Exit Else Delay 100 Milliseconds End If Repeat End
  11. Great idea! Too easy! I tend to use acantor's technique, but of course that only approximates the duration. In any case I think it's a good idea to have a delay inside the loop, even if a very short one, on the theory that the delay releases control to Windows so the computer can do something else during the REPEAT loop rather than just a CPU-bound loop. Of course I don't know if that's how ME interacts with Windows, but I contend it's a good theory in any case. ? For most "wait" loops I use 100ms as the delay, since 1/10 second is almost imperceptible to the user. Additionally, a timed delay is independent of processor speed, so the macro will appear to run more-or-less the same on older vs. newer PCs.
  12. I think Environment Variables are global in the sense that you need. These lines show how easy it is to save and recall text data to an "environment variable". As far as I can tell, you can give the environment variable just about any name you like, and it is created on the fly. For testing I just called it "xyz". If you store your speed value as text, you will need to use Variable Modifiy String and Variable Modify Integer to convert back and forth between text and integer for the number of milliseconds to wait. // Variable Set String %T1% "abcdefg" Text Box Display: %T1% Variable Modify String: Save %T1% to Environment Variable xyz Variable Set String %T1% "xxxxxxxxxxxxxxxxxx" Text Box Display: %T1% (should display the "xxxxxxxxxxxxxxxxxx" value just loaded into %T1%) Variable Set String %T1% from Environment Variable xyz Text Box Display: %T1% (should display the original "abcdefg" text) //
  13. OK, I guess after you read that much you deserve a rest. But no quitting early ....?
  14. As before -- modify it in a second, independent macro, and save it in a file or registry key or environmental variable. Reload it in the above macro, either immediately before or immediately after the REPEAT START line depending how soon you want it to take effect. That is, if you load it before REPEAT it won't take effect until after 1000 iterations; if loaded after REPEAT it should take effect instantly. Depending where the value is stored (file, registry, etc.) the load time will appear to slow the macro down so the keystrokes will be farther apart in time, especially if reloaded every time through the REPEAT loop. Just out of curiosity, what do you do after the 1000 REPEATs are done? End the macro? Why 1000 REPEATs as opposed to 10, or 100, or 10,000?
  15. If you are going to use a variable, why not skip the PLAYBACK SPEED command and use the variable directly in the DELAY command? If the variable is to be modified in a second macro, read the help screens on global vs. local variables to make sure the modified value is carried over from one macro to the other.
  16. Clever idea, to force yourself to speed-read? It doesn't matter too much where you store the speed-multiple, whether a text file or the registry or wherever. Use whichever approach is easiest for you to program. I like a file for something simple like this, if only because I can view and manipulate the file with Notepad, independent of Macro Express.
  17. It looks like Macro Playback Speed can do this, by (1) embedding Wait Time Delay (milliseconds) at various points in the macro, and (2) pre-loading a variable with a delay multiple. For example, put Wait Time Delay (%base_delay_milliseconds%) at various points in the macro, like before each mouse movement, text typing, etc. Very early in the macro logic, load a multiple into a second variable (%delay_multiple%), and issue the Macro Playback Speed command using %delay_multiple% as the parameter. You probably want a second macro, triggered by your plus-speed or minus-speed keys, to store %delay_multiple% into a file or environmental variable. Then each time the principal macro runs, it accesses the file/environmental variable in order to set %delay_multiple%. This makes the whole thing dynamic so you can change %delay_multiple% on the fly without re-coding the macro. I haven’t done what I have described above, but it looks like it should work. As far as I can see from ME Help screens, Macro Playback Speed only affects delay times, and does NOT affect other macro commands. Let us know how you make out with this.
  18. Copy/pasting from Excel may be slow, but my guess is that doing the math in ME would be slower.
  19. In what way is it not working? Do you mean the second and third boxes never appear? Are you having the multiple choice box return the TEXT of the selected item, or the VALUE of the selected item?
  20. I am using mex 3.9.0.1 on Windows 7. Texttype win does not work for me, either. Edit: Also does not work for me with ME Pro.
  21. I tried it with an MP3 file. At the scheduled time the macro ran, sounded a chime, then displayed the text box. The MP3 file was a short piece of music, so I'm not sure why it chimed instead of playing the music -- probably because ME doesn't know what program to associate with the MP3 file type.
  22. Sixteen IF statements in all, to place a displayable text character into a text variable: If Variable %N1% = 0 Variable Set String %T10% "0" End If If Variable %N1% = 1 Variable Set String %T10% "1" End If .... If Variable %N1% = 10 Variable Set String %T10% "A" End If .... If Variable %N1% = 15 Variable Set String %T10% "F" End If
  23. Yes, integer arithmetic would give a whole number quotient. To isolate the remainder you could multiply the quotient by 16 and subtract the product from the original random number -- again entirely with integer arithmetic. Or as you say, just generate two separate random numbers, one for each character you want to end up with. I tried "Variable Set to ASCII Char" and it did not product a useful result. I was assuming that you want displayable characters -- for example, random number 26 is hexadecimal x'1A', so you want two displayable characters, '1' and 'A'. You are right about having to work hard only for generating characters 'A' through 'F'. The test macro below will properly produce a text string for value '9' but will NOT produce an 'E' for value 14. Run it and see. Variable Set Integer %N1% to 9 Variable Modify Integer: Convert %N1% to text string %T1% Variable Set Integer %N2% to 14 Variable Modify Integer: Convert %N2% to text string %T2% Text Box Display: %T1% %T2% But you don't know ahead of time whether you will be generating a numeric character or a letter character. The series of IF statements I suggested will handle both cases.
×
×
  • Create New...