Jump to content
Macro Express Forums

rberq

Members
  • Posts

    978
  • Joined

  • Last visited

  • Days Won

    44

Everything posted by rberq

  1. Ah, but don't we all write intentionally-infinite loops (REPEAT UNTIL %X% IS NOT EQUAL TO %X%)? We do that because REPEAT START does not have a REPEAT INDEFINITELY option. But I agree -- it is always wise to explicitly limit the loop in case, heaven forbid, we commit an error in logic. Also, I generally embed the same 1/10 second delays like Cory does, if it's a macro the user is waiting for. Longer or shorter delays when waiting for the computer itself to finish doing something, when human perception is not involved.
  2. Look at the Repeat instructions. There is a "Repeat Until ...." that should do what you want. Though the logic might be easier if you use "Repeat Start...". For example, REPEAT START IF COLOR1 = XXXX AND IF COLOR2 = YYYYY DO STUFF ELSE REPEAT EXIT END IF END REPEAT
  3. A .mex file is not a macro. A .mex file contains many individual macros. You don't have to open the .mex file every time you want to activate a macro. Once you open it, it stays open, and all the macros within it can be activated via their hotkeys.
  4. If you copy the .mex file AFTER installing MEP on the new computer, the installation will already have created a .mex file. In Macro Explorer you can select File | Open to access the copy containing your macros, rather than the skeleton produced by installation.
  5. See screen image below. The file that MEP is working from should appear at the bottom of the screen, where the red arrow is pointing. You can copy the entire .mex file from the 'old' computer, and put it on the new computer -- just be sure to name it differently from the file that MEP is working from. Then in Macro Explorer, select File | Import | Import Macros, specify the copied .mex file at the bottom of the import screen, click Open, then select the individual macros to be imported.
  6. Do you mean Macro Express no longer starts up automatically when you start Windows? Or do you mean it no longer works, period, even if you start ME manually? Try reinstalling Macro Express and see if that starts it working again as you expect it to work. Then just for fun see if the deleted items have come back.
  7. I'm going to make a SWAG (Silly Wild-A** Guess). It's not a solution so it will satisfy no one. And my knowledge of Windows structure is vague enough I could be totally wrong. There -- so much for disclaimers. Q-Dir has been around for a long time. Over the years, an application's relationship to the keyboard has evolved from the primitive ability to interact directly with the BIOS, to present-day highly-structured "layers" of software between the application and the hardware. Perhaps Q-Dir generally adheres to Windows conventions, but has an old embedded module or two using an outdated technique that still works, but that sneaks in below the officially-correct level used by MEX. Like coming in the back door instead of the front. So sometimes MEX and Q-Dir communicate just fine, and sometimes not. OK, there's my semi-magical-mystical view of the machine's mind. Works for me, you guys can come up with your own religion. 😐
  8. Has either of you tried activating the macro with a hotkey that does not use ALT or CTRL? I like to use the keypad symbols -- slash, asterisk, minus sign, plus sign.
  9. Silly question, maybe --- do you by chance have some other macro triggered by <CTRLD>1<CTRLU> ??? Edit: Another simultaneous posting. acantor beat me this time.😐
  10. I have had macro typing fail intermittently if the keystrokes are entered too fast. Most of my macros have this standard command at the beginning: Keystroke Speed: 30 milliseconds That's usually fast enough to keep me from fidgeting, but slow enough so the application is not overwhelmed. Edit: Oops! We posted at the same time. I see you have already tried that.
  11. You can insert message boxes like this at many critical points in your macro, to determine how far the macro has progressed. Within the message box you can also display the values of variables, if you are wondering why IF conditions are not being met, and so on. Once debugging is complete, remove the message box commands -- or, better, just inactivate the commands so you can re-activate them six months from now when something changes and the macro suddenly stops working. 😉
  12. IF the Citation window ALWAYS appears in the same location on the screen, perhaps your macro could move the mouse to the specific location on the screen where the icon resides, then click the mouse. I have several macros triggered by hotkeys that do this, and as long as I run full-screen windows, the icon location is consistent. Of course, an application update sometimes moves the icons a little bit, then the macro must be adjusted for the new location.
  13. I was thinking of something similar. Maybe open the script in the Direct Editor, copy all to the clipboard, manipulate whatever needs to be manipulated to add a variable, then paste the modified content back into the Direct Editor, overlaying the original macro. Seems like a good way to get into trouble .... I have been trying to figure out why anyone would WANT to create variables on the fly. Perhaps to set up the "data" environment all at once, before starting to write the procedural logic for a macro. You could make a spreadsheet or text file with variable names and attributes, then read the file with a macro and make the variables all at once. Labor saver??? Or not?
  14. In the .bat file, put a PAUSE command at the end, for testing. That should keep the window from closing, so you can see error messages. Or try sending the output to a text file that you can examine: start "C:\Program Files (x86)\Macro Express Pro\MeProc.exe" /APosteingang > c:\temp\temp.txt
  15. If the macro does not have to interact with the screen, you can run it using macexp.exe or meproc.exe. At least, I don't think it can interact with the screen. I don't know what happens if you launch meproc.exe from within a macro to start another macro, then manually switch to another window. Look in the ME Help system at Command Line Parameters.
  16. Windows Virtual Machine? VirtualBox? https://www.howtogeek.com/196060/beginner-geek-how-to-create-and-use-virtual-machines/
  17. . If you know approximately where the daughter window is, even if it moves slightly, you can search for the title bar by color. The logic below searches downward, 8 pixels at a time, looking for a type-in field that is a particular shade of gray. It is much faster to search in 8-pixel increments, instead of pixel-by-pixel, and 8 pixels is enough precision for the field I am looking for. If the Repeat loop "expires" without a color match, an error is displayed and the macro ends. If the expected color is found, the mouse is placed a few pixels further down, so as to be well within the field. // Find the type-in area by color Variable Set Integer %xc% to 300 Variable Set Integer %yc% to 100 Repeat Start (Repeat 150 times) Get Pixel Color at (%xc%, %yc%) Relative to Screen into %color% If Variable %color% Equals "4343115" Repeat Exit Else Variable Modify Integer: %yc% = %yc% + 8 End If End Repeat If Variable %color% Equals "4343115" Else Text Box Display: Diagnostics // Display error Macro Return End If Variable Modify Integer: %yc% = %yc% + 15 Mouse Move: %xc%, %yc% Relative to Screen // Place mouse down a little from the top edge of the entry field
  18. If you are manually moving the window, then perhaps the macro can move it -- not by repositioning commands, but by locating the top margin of the daughter window, then mouse-left-button-down a little below the margin, then mouse move upward and leftward, then mouse-left-button-up. Check out "If Mouse Cursor" in the Logic commands -- you can move the mouse down a few pixels at a time, checking for a change in the pointer as it moves over boundaries and over icons.
  19. IF the daughter window always appears at the same location on the screen, you can move the mouse relative to screen rather than relative to window. If the daughter window can be moved around, the macro could conceivably grab it with the mouse and slide it to the top left of the screen -- again you could then move the mouse relative to screen. But I'm with acantor here -- if you can navigate the window via the keyboard, you will probably improve reliability and reduce headaches.
  20. Probably you could use the ASCII File Process, but hard-code the parameter descriptions in your Text Type commands. For example, if you use an array named "column" to receive the file (spreadsheet) rows, the X parameter will be the second item of the array. So Text Type X Text Type <SPACE> Text Type %column[2]% Text Type <ENTER> Or for each parameter make a single Type statement like in your example: Text Type _bminsert <ENTER> %column[1]%<ENTER> Text Type X %column[2]%<ENTER> Text Type Y %column[3]%<ENTER> Text Type Z %column[4]%<ENTER>
  21. Right, you can not use "text file process" because ME brings in one line at a time into a variable, but does NOT bring in the CRLF. "Variable Set String" will not be part of your loop. It will be executed only once, to bring the entire text file into a variable. CRLF sequences will just be more characters in a single long undifferentiated string in the variable. Then a loop can extract each line, one at a time, by locating the next CRLF. The variable containing the whole text file will look something like this: "Line1textCRLFLine2textCRLFLine3textCRLFLine4textCRLF.... " It is only in your mind, or in Notepad, that the string is organized into separate lines.
  22. P.S. What text editor did you use to get this display? I'm looking for something a little more functional than Notepad. Thanks.
  23. Text File Begin Process reads one line at a time, and I believe it strips the CRLF, so your macro will never see the CRLF (as you have found!) I think Samrae is suggesting that you use the command Variable Set String, with option "Set Value from File." That single command loads the ENTIRE file into a text variable, bang, all at once. See illustration below -- my screen shot is ME Pro, but ME3 is similar. When you use this command, the data loaded into the variable retains the CRLF characters. The checkbox to Strip Trailing CR/LF is deceptive -- if you check the box, it strips the FINAL CRLF from the end of the file, but does NOT strip any others. So you could get the entire file into one variable, then write macro logic to parse out the individual lines, with CRLF sequences where you expect to see them.
×
×
  • Create New...