Jump to content
Macro Express Forums

rberq

Members
  • Posts

    989
  • Joined

  • Last visited

  • Days Won

    44

Everything posted by rberq

  1. 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
  2. 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.
  3. Windows Virtual Machine? VirtualBox? https://www.howtogeek.com/196060/beginner-geek-how-to-create-and-use-virtual-machines/
  4. . 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
  5. 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.
  6. 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.
  7. 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>
  8. 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.
  9. P.S. What text editor did you use to get this display? I'm looking for something a little more functional than Notepad. Thanks.
  10. 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.
  11. 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.
  12. // 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?
  13. 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).
  14. 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.
  15. 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....
  16. 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.
  17. My first thought, too, and that's what I have done. But I don't like it!
  18. Alas, not practical. Too many miscellaneous macros that may type Backspace.
  19. I have a macro, A, that I trigger with the Backspace key. I have another macro, B, that (among other things) simulates typing a Backspace. The problem is, when B "types" Backspace, it triggers A to run, which causes havoc. How can I keep A from running in this situation? Both A and B sometimes are used in the same applications, so I can’t limit A by Scope. Any other suggestions?
  20. What application contains the text? Could you possibly use the Macro Express "Window Resize" command? Can you show us the macro command(s) you are using to type WIN_F12? Something like this? Text Type (Simulate Keystrokes): <WIND><F12><WINU> Delay: 250 milliseconds Text Type (Simulate Keystrokes): <WIND><F12><WINU> Delay: 250 milliseconds Text Type (Simulate Keystrokes): <WIND><F12><WINU>
  21. Of course it's pointless. But fun. Maybe next winter when I am snowed in..... πŸ˜‹
  22. Yes, always fun watching a macro follow your instructions in real time. I think robotics would be fun for the same reason -- program your own Mars Rover to navigate the back yard. Here's another method that might be fun to try: Have your script take a screen shot of the Properties window, pass it to text-recognition software, then parse and read out the results.
  23. Sorry, I expressed that badly when I referred to the macro issuing a DOS command. The macro can: (1) Delete any existing file C:\Temp\Temp.bat (2) Build a new file C:\Temp\Temp.bat containing the DIR command -- last command of the .bat file should be "exit" (3) Program Launch C:\Temp\Temp.bat (4) Text File Begin Process to read back and process C:\Temp\filelist.txt (output of DIR command) The sample below works to create and run the batch command file. I haven't coded the Text File Process step to read back the report file. It may need some code after launching the batch file -- a delay at the very least -- to determine when the report file is ready to process. // Delete File/Files: "c:\temp\test.bat" Variable Set String %line% to "cd\" Variable Modify String: Append %line% to text file, "c:\temp\test.bat" Variable Set String %line% to "dir c:\onedrive /s > c:\temp\filelist.txt" Variable Modify String: Append %line% to text file, "c:\temp\test.bat" Variable Set String %line% to "exit" Variable Modify String: Append %line% to text file, "c:\temp\test.bat" Program Launch: "test.bat" (Normal) Parameters: Macro Return //
  24. Very clever. And simpler than mine. I never thought of piping the output to another command, and to be honest I wasn't even familiar with "find". Now if we direct output of "find" to a text file, ME can very quickly read it and display the message box called for by the original challenge. Microsoft over the years has quietly made the traditional "DOS" commands much more powerful and elaborate. And usually, these days, they actually work, which is a change from the good old days. πŸ˜‰
×
×
  • Create New...