Jump to content
Macro Express Forums

rberq

Members
  • Posts

    1,200
  • Joined

  • Last visited

  • Days Won

    61

Everything posted by rberq

  1. 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.
  2. 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.😐
  3. 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.
  4. 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. 😉
  5. 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.
  6. 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?
  7. 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
  8. 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.
  9. Windows Virtual Machine? VirtualBox? https://www.howtogeek.com/196060/beginner-geek-how-to-create-and-use-virtual-machines/
  10. . 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
  11. 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.
  12. 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.
  13. 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>
  14. 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.
  15. P.S. What text editor did you use to get this display? I'm looking for something a little more functional than Notepad. Thanks.
  16. 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.
  17. ME3 should be fine. I used ME3 until recently. No problem finding LF, CR, and CRLF in Notepad and MS Word. If your text is stored in Unicode you will have problems with ME. I'm a little fuzzy in my mind as to just what Unicode is, and which applications use it. In the past I have had success opening these files with Notepad, then saving Notepad as ANSI, then having the macro work with the ANSI file.
  18. // Line Feed (New Line) character ascii 10 Variable Set to ASCII Char 10 to %LINEFEED% // Carriage Return character ascii 13 Variable Set to ASCII Char 13 to %CARRIAGERETURN% // Carriage Return / Line Feed combination characters ascii 13 + ascii 10 Variable Set to ASCII Char 13 to %CRLF% Variable Modify String %CRLF%: Append Text String Variable (%LINEFEED%) // Variable Set Integer %position% to the position of "%CRLF%" in %text% It sounds like that is what you are doing. You don't, by chance, have the 13 and the 10 reversed?
  19. The only way I have found is to redirect the output to a text file, then read back the text file with the macro script (Text File Begin Process).
  20. The dropdown in Text Box Display has an option to close the text box. When you select Close, just make sure that "Header" matches the original Display.
  21. Sample of a few lines of your text file would be useful. Sample of what the output text file should look like. Ideally, sample or URL for the web page if it's not proprietary. Sometimes it works well to copy the entire web page to the clipboard, then from clipboard to a variable, then find and count the search items by repeated "IF VARIABLE CONTAINS" commands. Expanding on what Cartwheels has coded....
  22. Firefox very recently stopped recognizing Backspace, after debating for ten or fifteen years whether to do it. That's why I wrote my macro. If in Firefox, the macro clicks the Back button. If not in Firefox, the macro simulates typing Backspace, so as not to disrupt its many other uses. So far I am using the Insert key to trigger the macro, which on my keyboard is right above Backspace. But I was hoping to have my cake and eat it too.
  23. My first thought, too, and that's what I have done. But I don't like it!
×
×
  • Create New...