Jump to content
Macro Express Forums

rberq

Members
  • Posts

    1,195
  • Joined

  • Last visited

  • Days Won

    61

Everything posted by rberq

  1. Very clever solution to an old problem. You should submit that as Insight's macro of the month and get a tee shirt or whatever.
  2. I hadn't anticipated that issue. Thanks for the warning. My first idea, like yours, was an always-open mex file containing the common macros. I don't quite follow your explanation of why you can't do that. The problem only happens when you have more than one macro file open, but you normally have only one macro file open, so why is it a problem? You could create a macro that disables the common macros, and another that enables them. Then run the disable just before you close a mex, and run the enable just after opening another mex. It would be an effort to remember to do it, unless you can come up with a way to do it automatically.
  3. Now that you have captured the macro, open it with the script editor (not the direct editor) and remove whatever mouse commands are positioning you to the wrong place. Once you are familiar with the script editor, you probably won't do much capturing of macros. It's often cleaner just to create a macro from scratch with the editor. For what you are trying to do right now, your whole macro will probably consist of a single line: TEXT TYPE [John Doe]
  4. If I understand you correctly, Macro A is running, and you want Macro B to stop A from running. The Macro Stop command ends the macro in which the command is coded. In other words, Macro A can end itself with the Macro Stop command, but B can't stop A. In B, try using the Macro Disable command to disable A. I think that will stop A in mid-stream if A is running. It will also keep A from running again, until you issue a Macro Enable.
  5. You CAN put the modified variable into the clipboard: VARIABLE MODIFY STRING/SAVE TO CLIPBOARD (it's on the second tab). But I have had little success with pasting from the clipboard, regardless whether I use the CLIPBOARD PASTE command (which says it issues Ctrl-v), or the clipboard-paste option of the TEXT TYPE command, or by directly typing Ctrl-v. It works sometimes in some applications on some PCs, but not reliably everywhere.
  6. I think the Preferences for keystrokes is 300 microseconds, not milliseconds. That's not much time, but I think you can leave it at the default if you set Keystroke Speed in your macros. I have had to set Keystroke Speed AND Mouse Speed in many macros -- 30ms seems to work pretty well, though some applications are happy with much lower values. Like you, I have found that Wait for Text Playback makes the macros more reliable, though it is kind of slow! Wait Text Playback will not always compensate for a too-fast Keystroke Speed. If you are typing a long string of data, and keystrokes are delivered very fast by ME, then the Windows or application keyboard buffer can be overflowed because characters are coming in faster than Windows can handle them.
  7. FWIW, I always use the sequence <CTRLD>u<CTRLU> instead of <CONTROL>u. In other words, separate operations for pressing down the Control key and for releasing it. Either way is supposed to work, but I have found the separate operations to be more reliable on some PCs. If you don't have Keystroke Speed set, try setting it to 30ms or thereabouts before typing the Control-u sequence. You might try a brief pause after typing Control-u to give the application time to digest it. Make sure the window is ready to accept keystrokes. For example, if you ACTIVATE WINDOW and immediately start typing, you may be outrunning the machine. Try a half-second delay prior to typing.
  8. Move your string to another text variable (T99, say) so the original won't be destroyed by the following. Then VARIABLE SET INTEGER N99 from position of text (space) in T99. If N99 is zero there are no spaces at all in T99, so you are done. If N99 is greater than zero, add 1 to counter. VARIABLE MODIFY STRING replace substring " " with "x" in T99 (choose the option to replace just one instance, not all instances). At this point you have counted the first space (if there is one), and then replaced it with the letter "x". Now repeat the above until N99 is zero (all spaces have been counted and replaced by "x"). Whatever is in your counter is the number of blanks that were in the original string.
  9. <IFOTH:04:2:lotusnotes><ACTIVATE2:lotusnotes><ENDIF> If Window Title "lotusnotes" is running Activate Window: "lotusnotes" End If On the IF command, choose the option Partial Match for the window title, not Exact Match. The Activate Window command always uses Partial Match.
  10. Don't schedule the "working" macros. Write a "driver" macro that is scheduled to run at 7 AM, and all it does is runs the other macros in the desired sequence.
  11. Tried adjusting Text Type Delay as high as 100,000 and it still was choppy. The macros already had Keystroke Speed of 30ms. But the application is working OK now, I just added Text Type <TAB> to tab out of the dropdown fields and that closes the dropdown list.
  12. I have macros that identify windows by checking color "maps" with a few dozen pixel locations in each map. Like you, I also have seen that pixel locations can change slightly -- even within the same PC from one day to the next! -- so I am careful to map to the middle of fields, and don't check too close to the edges. Also, color value changes on a machine running 16-bit vs. 32-bit color, so I have two sets of color maps. But I have not seen any problems from machine to machine, other than those two differences. The macros run on dozens of PCs of different varieties. P.S. (Oh, yes. Pixel location may change, depending on the application, if you change screen resolution. For some applications it matters, for some it doesn't.)
  13. Most entries to form fields are like this: Text Type (Simulate Keystrokes) <TAB> Wait for Text Playback Text Type (Simulate Keystrokes) %T[x]% Wait for Text Playback What I see on the screen is that ME Pro's "Text Type" is very choppy. If for example variable T[x] contains thirty characters, five or six characters will be typed, then there is a visible delay, then one or a few more characters, another delay, then a few more, and so on. I think this explains the dropdown lists -- where ME3 zipped through typing the whole field, MEP may initially type one or two characters, then delay, and the dropdown opens during the delay. So that explains the dropdowns, but what explains the choppiness? Testing so far shows choppy typing into Citrix windows. When typing into an IE7 page, typing is steady with no choppiness. This is on a comparatively slow PC. Incidentally, the Wait for Text Playback seems to be much faster with MEP (either that or the wait is being ignored and I just don't know it yet).
  14. Thanks for the tip, John. I'm going through the same thing now -- multiple iterations of importing several dozen ME3 macros to MEP, then using a macro to apply a set of edits to each of the imports. Your method will be a time saver.
  15. Confirmed on my PC. Not fixed in 4.1.5.1. Doesn't seem to matter what macro you are editing, closing the editor ends one or two running macros. Probably ends 3 or 4 or 5 or 99 -- I just didn't test above 2.
  16. I like a variant on your job file drop. But it could be a single file, where each line in the file represents a job. Job (macro?) name would be one field of each record. Include a position in each record of the file for a status code: e.g. new, in-progress, complete. You could easily enqueue on the job (macro) name if you need to prevent the same job from running more than once simultaneously. Add date and timestamps for creation, job-start, job-end, etc. to whatever degree is useful. Pass parameters from the initiator to the macro if necessary. You can be as simple or as fancy as you want in the design. You will probably wind up with a set of common macros that will check and post conditions to the job file, and either call or be called by the macros that perform the business functions. In other words, pretty much a standard interface or queuing system, where one or more systems put items on a queue, and one or more other systems dispose of the items. A single job file, on a network share available to "everybody" is simple as long as the loose security is not too much of an issue.
  17. Had to be a bug. It was inconceivable to me that you and I could both be that dumb. If it affects ONLY release 4.1.3.1 that could explain why others haven't seen it. Your average non-professional user probably does not get into arrays. It's scary, though, that this kind of bug would crop up in a maintenance release. I am testing dozens of macros in applications that register hospital patients, to convert the users over to ME Pro. It does nothing good for my credibility if we are bringing patients into the Emergency Room and the process goes to hell in a handbasket due to a silly ME bug.
  18. I'm stumped. I played with your macro for half an hour, and I get the same result you do. It's as if the IF statement were not there at all (or always results in a not-equal condition). I displayed the variable values in a text box immediately before the IF. I changed the "if not-equal" to "if equal" with an "else". I moved the array elements to the old T[xx] variables and displayed those and compared on those instead of on the array elements. I trimmed the elements before the compare. No matter what I do, the output file is simply a copy of the input. Either there's something seriously wrong with Macro Express, or you and I are both missing a really stupid error in the logic. I think YOU should report it to Insight as a bug, so I don't have to take the hit for a dumb question.
  19. Are you clearing your output file between tests? Duplicates left over from an earlier test, maybe?
  20. The logic looks like it should do the job of removing consecutive duplicates. However, that's not the same thing as removing ALL duplicates, and it will not sort the array.
  21. When you type the ENTER key in notepad to end a line, what is actually inserted into the notepad file is a two-character sequence Carriage Return / Line Feed. These are ASCII character values of 13 / 10. So instead of splitting on <ENTER>, first set two one-character string variables like so: Variable Set to ASCII Character 13 to %CRLF% Variable Set to ASCII Character 10 to %LF% Then append the LF to CRLF to make a two-character string variable, %CRLF% Split on %CRLF% rather than on <ENTER> <VARIABLE SET TO ASCII CHAR Value="13" Destination="%CRLF%"/> <VARIABLE SET TO ASCII CHAR Value="10" Destination="%LF%"/> <VARIABLE MODIFY STRING Option="\x07" Destination="%CRLF%" Variable="%LF%"/> P.S. Your plan to activate the macro based on the window gaining focus, should work nicely. You will still have the issue of figuring out whether one line has been added since last time, or more than one line. Cory and I suggested ways to do that in your previous thread.
  22. You say you can use the XP clipboard viewer to save the contents of the clipboard to a file, and you can view that file in Notepad. So, maybe you could write a macro that uses ME commands to: 1) launch the XP Clipboard Viewer 2) type the keystrokes needed to save clipboard contents to a file 3) open the save file in Notepad 4) copy from the Notepad screen into the clipboard 5) parse the new clipboard data and extract the file name and path Steps 3 & 4 might be replaced by simply reading the save file into a ME variable. Step 5 might be very easy, or it might be the trickiest. It depends on what "garbage and shell extensions stuff" surrounds the data you want to extract. If you are not familiar with using ME to parse strings, post an example of the data you see in Notepad, and we can probably give you advice on how to do it.
×
×
  • Create New...