Jump to content
Macro Express Forums

stevecasper

Members
  • Posts

    570
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by stevecasper

  1. Hey Terry, I just used your code to see if I could duplicate your problem. Have you checked to make sure the "Floating" box isn't just hiding behind the "Child" box? I moved the "Child" box out of the way and "Floating" was still there.
  2. I do this all the time. I'm constantly counting the occurrences of words, number sequences, you name it. Not just in text files, but also if I need to find a specific number sequence on a screen (which looks an awful lot like staring at green floating characters in the Matrix), and need to know how many times that sequence appears on the screen, I use a macro just like this or very similar. Here you go: In the Scripting Editor it looks like this: Variable Set String %T1% from File: "text counter.txt" Variable Set String %T2% from Prompt Variable Set Integer %N1% from Length of Variable %T1% Variable Set Integer %N2% from Length of Variable %T2% Replace "%T2%" with "" in %T1% Variable Set Integer %N3% from Length of Variable %T1% Variable Modify Integer: %N4% = %N1% - %N3% Variable Modify Integer: %N5% = %N4% / %N2% Text Box Display: Final Count The Direct Editor script (copy from here into your macro) looks like this: <TVAR2:01:04:C:\Users\Steven\Desktop\text counter.txt><TVAR2:02:02:FWhat word needs to be counted?FFCenter:Center><IVAR2:01:12:1><IVAR2:02:12:2><TMVAR2:21:01:01:000:000:%T2%><IVAR2:03:12:1><NMVAR:02:04:1:0000001:1:0000003><NMVAR:04:05:1:0000004:1:0000002><TBOX4:T:1:CenterCenter000278000200:000:Final Count%T2% appears %N5% time(s) in this document.> Of course you may need to make some adjustments for your file location etc. but the math (everything to do with the %N% variables) is how you count the occurrences of whatever word (or any string of characters - including spaces) you desire. Here's the basic explanation. If the file is 1,000 characters long, and the word you want to count is 5 letters long, you do the following math: N1 = 1000 (the length of the file). N2 = 5 (the length of the word). Now you replace the word with "" in the file. If the word appears 5 times, then the file gets shorter by 25 characters (5 occurrences of a 5 letter word get replaced with "" (blank) - 5x5=25). In this example we know this, but the macro doesn't know it yet. So we continue. We set N3 to the length of the file after removing all occurrences of the word. Therefore N3 = 975. The next step is to have the macro determine the difference between the original length of the file and the new length of the file: N1-N3 = N4 which is 1000-975 = 25 N4 = 25 Great. Now we divide N4 by the length of the word: N4/N2 = N5 which is the same as stating 25/5 = 5. The word appears 5 times.
  3. Hi Rand, You went to a lot of work to build this macro, and it looks pretty good. I know you didn't ask for any advice or help, so I hope my reply doesn't offend; but I have some suggestions of things you might want to experiment with to help stream-line the process (and possibly shorten the macro a bit). This is the beginning of yours (note, I've removed the disabled Text Type commands to minimize confusion): Clear All Variables: All Clipboard Empty Clipboard Copy Launch and Activate: "notepad.exe" Clipboard Paste You might consider replacing this chunk with something along the lines of: Clipboard Copy Clipboard Save Text: "testfile.txt" After which rather than using a Repeat Loop and systematically moving through line after line searching for the text you want, you could use a Text File Process loop which will process each line of text in the file that we just created (in my example I used the Browse button within the Clipboard Save Text command to browse to my desktop and then typed testfile.txt - the Save Text command will create that file automatically). The Text File Process loop will go through each line individually, automatically moving on to the next line on each successive loop without having to delete the lines as it goes. What's more, it does this all "behind the scenes" as it were. No need to have a notepad on top, and it is generally quite a bit faster than doing things up front. Text File Process and ASCII File Process commands are very powerful (and fun to learn if you're inclined to sit and play with them). I didn't look into any specific ways of tweaking the code within the Loop, because within a Text File Process, you'll basically do the same thing, just without any of the Text Type commands that delete lines (dramatically shortening the macro's length as well as speeding the macro up a bit). Also, since I don't actually need to do what this macro does, I can't really experiment with it and find specific areas of improvement. For the most part, I think you've built a very good macro that could be simplified by using more powerful commands that you may not have been familiar with. Oh, one last thing: Delete File or Files: "testfile.txt" Empty Recycle Bin Adding this to the very end of the macro will delete the file we created for the Text File Process, and then empty the recycle bin so that if you run this macro often, your recycle bin doesn't hold onto it (note, I would add these commands to the end, but keep them disabled until you've finished all your debugging).
  4. I can't speak for the developers, but from my understanding, the limits or performance issues one might experience when running a macro containing vast numbers of variables would be affected primarily by the system the macro is being run on (ie., Intel Quad Core 2.6GHz with 8GB RAM, will handle it much more smoothly than a P3 800MHz machine with 256MB RAM). But for an undeniably correct answer, the devs will have to reply.
  5. Thank you both. Now I understand the confusion. Yes, the \ was used to separate the variable (path) from the .txt file as I hadn't included the \ within the variable itself.
  6. I see. I didn't catch that you had used the capture feature. I honestly have never used that feature myself, so couldn't even begin to help trouble-shoot from experience. I am certain, however, that if you clicked the mouse-button during capture, then the macro would record that action. I don't know anything about encryption causing errors when logging in using a macro. I use Macro Express to log into a lot of different apps without any problems. But then again, I don't use the capture method. I thought you were MacroMarketer, you should probably contact Insight Software Solutions for support (unless, of course, that's who you meant).
  7. Are you sure? Once I realized that I forgot to add the destination variable, the macro worked fine. In fact, when I browse to a location, the back-slash '\' is displayed by Windows itself. Note, the following screenshot shows a browsed-to file:
  8. That is from the Direct Editor script. The Scripting Editor script is the "readable" script (which I posted first), the Direct Editor script is the actual code that Macro Express uses to make the macro run. Essentially: <MOUSE MOVE Option="\x01" X="229" Y="429" _PROMPT="0x000A"/> Means: Mouse Move: 229, 429 Relative to Screen The Direct Editor script in my example is so you could copy and paste it into a macro and then run it to see how it works. The Scripting Editor text is so you can look and see what it's supposed to do. I still don't understand if you are trying to copy the text or paste it, though.
  9. Nevermind. I'm an idiot. I failed to provide the "Destination" variable.
  10. I'm trying to build a macro using ASCII File Process. I get the following error (it doesn't matter if I set to comma or tab delimited): And here is a screenshot of my editor window. I even went with a basic %T[1]% variable just in case my named variable was causing confusion: I've used ASCII File processes before (in ME3), but this is the first time I've attempted to build one in ME Pro. Am I missing something that should be obvious, or is there a bug? I scanned through the forum quickly but didn't see this particular problem.
  11. Following your layout, I designed the following macro (first Scripting Editor format, then Direct Editor format): Window Activate: Copy range 315,158 to 770,325 - Macro Express Forums - Microsoft Internet Explorer Mouse Move: 229, 429 Relative to Screen Mouse Left Button Down: 229, 429 Relative to Screen Mouse Move: 480, 683 Relative to Screen Mouse Left Button Up: 480, 683 Relative to Screen Clipboard Copy <WINDOW ACTIVATE Title="Copy range 315,158 to 770,325 - Macro Express Forums - Microsoft Internet Explorer" Exact_Match="FALSE" Wildcards="FALSE" _IGNORE="0x0006"/> <MOUSE MOVE Option="\x01" X="229" Y="429" _PROMPT="0x000A"/> <MOUSE LEFT BUTTON DOWN/> <MOUSE MOVE Option="\x01" X="480" Y="683" _PROMPT="0x000A"/> <MOUSE LEFT BUTTON UP/> <CLIPBOARD COPY/> After running the macro, I began this reply, and then used Ctrl+V to paste my results, and here they are (please note, this is exactly what I expected to have - Also I added bold after pasting in order to distinguish the pasted information from the rest of my post.): Not having much luck. I'm tring to copy a range with no luck. Activate Window: "Construction Services and Materials Report - Windows Internet Explorer" Mouse Move Window 315, 158 Mouse Left Button Down Mouse Move Window 770, 325 Mouse Left Button Up Clipboard Paste Bob I just switched to Pro and still no go. My first observation is that you have a Clipboard Paste where you need a Clipboard Copy... Of course I'm assuming you actually intend to copy. If you are really intending to Paste, then you should read Terry's post above mine.
  12. This might be so obvious you missed it, or so obvious it will be offensive for me to suggest it... but have you made sure the webform has focus? Focus can be gained by using Control commands (assuming they work on the webform), or simply by using a Mouse Move command - hovering the arrow over the webform, and following it with a Mouse Click command. I haven't used this particular Google utility before (and can't log into Google from work to test it out), but this would be my first suggestion.
  13. Sorry, I've been busy for a while. But my answer is basically: "What Kevin said."
  14. Hey Terry, Sorry, I've been away from the forum for a while (work, sick kid, life, etc.). In theory, your suggestion is probably the best one for my particular situation. A lot of the solutions presented were good ones, in fact, and yours is by far the most convenient for the way I generally think and work. Frankly, in my opinion and based on my understanding, a command like "Wait for text playback" which doesn't appear to have any function outside of the Text Type command shouldn't even exist outside that command. Obviously, though, the foks at Insight are a bit more brilliant than me, and they certainly understand their own software better than I do, so I'm sure there are perfectly valid reasons for the command standing alone. Just a bit surprised that they didn't also incorporate it within the Text Type command itself. Certainly not complaining, of course, as I don't honestly know what I would do without Macro Express. It's a lovely program that has brought me hours of creative fun (seriously, I will sometimes play with ME at home just for fun... hours spent in front of the computer trying to build macros I will never have any use for just so I can show my wife "Hey honey, look how cool!" and watch her roll her eyes at me and call me a nerd... she's a Highschool math teacher and I'm the nerd?) And that's a ramble.
  15. Sorry, I haven't been to the forum in a few days, so I apologize for the delay. The two codes I offered were actually the same code. The first one was the Script Editor code (what it looks like for laymen), and the second one was the Direct Editor code (the actual scripting that is the macro). The only one you need to make the macro run correctly is the Direct Editor code.
  16. Thanks for all the replies. Adding it to my favorites, or setting up a text-type/wait for playback snippet are options to keep me from having to hunt the playback out. Or even reorganizing my categories to have wait for playback next to text-type would be fine. My goal, however, was to clean up the scripting editor, so that instead of having some sections of macro that look like this: Text Type (Simulate Keystrokes): Type this and wait Wait for Text Playback Text Type (Simulate Keystrokes): Type this and wait Wait for Text Playback Text Type (Simulate Keystrokes): Type this and wait Wait for Text Playback Text Type (Simulate Keystrokes): Type this and wait Wait for Text Playback They would look like this: Text Type (Simulate Keystrokes): Type this and wait Text Type (Simulate Keystrokes): Type this and wait Text Type (Simulate Keystrokes): Type this and wait Text Type (Simulate Keystrokes): Type this and wait This is an exaggeration, but it expresses the idea clearly. I submitted a feature request, and they're going to look into it; but it's obviously a low priority, which I'm fine with. Too many bugs to really worry about something cosmetic like this right now.
  17. I think this was discussed back in December. it's a bug, but it shouldn't affect the way ME Pro runs. Give it a few extra seconds/minutes and it eventually disappears. In the mean time, you can continue to run macros. I'm not sure about the macro it is supposedly running, though... hmmm.
  18. My Suggestion If Macro Express macros can be activated while running the game (not all games allow you to run third-party macros), and it sounds like they can be, in your case then try this: Rather than pressing Enter to start typing your "speech" text, try this: Set a hotkey activation, such as Ctr+Alt+Shift+T (just for example) Set the following code within that macro: Variable Set String %T1% from Prompt Text Type: <ENTER> Wait Text Playback Text Type: %T1%<ENTER> Wait Text Playback <TVAR2:01:02:FWhat do you wish to say?FFCenter:Center><TEXTTYPE:<ENTER>><WAITPB><TEXTTYPE:%T1%<ENTER>><WAITPB> With this code, you don't have to worry about your WASD keys misbehaving. When one macro is running, all other Macro Express 3 macros are automatically disabled, allowing you to use your WASD keys freely within the text prompt. Then, when you're done filling in the prompt, the macro will activate your "speech" box (with Enter), type out the text saved in the prompt, and press Enter again automatically to send the message. If this doesn't work exactly, minor modifications based on how the game runs should work for you.
  19. I get that. It wasn't immediately obvious to me, but after much discussion with Cory it finally sank in. Awesome! Thank you very much for looking into these issues! I understand the array principle... My point was that I don't have to add a variable named "T" to every macro in order to have it available as it is built-in. But you are addressing something that should be very similar to what I'm looking for with the afore mentioned issue [iSS6575]. And any other issues related to using the same variable in multiple macros and (where the variable will contain the same information) would/will no doubt be corrected by adjustments to the Save/Restore functions. I'm grateful for your reply. Thank you very much!
  20. Now that I have started using Wait for Text Playback rather than delays or just assuming that the macro will complete the command before moving on (which was a false assumption, it turns out), I'm getting annoyed by just how often I have to hunt down Wait for Text Playback. Ok, so I only have to hunt it out once, and then just Copy the command, after I've finished building the macro, and paste it throughout where needed. Still, I think it would be logical to have a "Wait for Text Playback" checkbox within the Text Type Command window. Am I alone on this, or does anybody else think this would be a worthwhile addition? I'm going to sumbit the feature request anyway, but I thought I'd get a sounding from other posters.
  21. Well, it's been more than a week without a response explaining why the Save / Restore function doesn't work in the above cases, so is it safe to assume there is no reason? I don't want to submit a bug report unless it actually is a bug. I have quite a few macros that are built in the format of a "parent" macro calling on one or more specialized macros. Save/Restore working within the specialized macros would save me in those instances where I forget to add new variables to the "parent" macro. An even better option would be that when a variable is created, an option to make it available to all macros (like the built in T, N, and D variables). In fact I may just officially submit that as a feature request.
  22. Hi all, This question is for Kevin, Stan, Jason, or anybody else who really knows the answer (speculation is fun, but I just need to know the truth). In a previous thread Cory helped me to finally grasp the Macro Called concept with regards to Global variables and for that I'm grateful. However, in the course of that thread a new situation reared its head (strange term, that: rear one's head... nothing at all like heading one's rear... I digress). For lack of a better diagram, I'll use the same as established in that thread: 3 Macros (A, B, and C) in which A calls B and then calls C. B creates a named variable %var% C uses that variable If A does not have %var% defined then by the time A calls C, the contents of %var% are lost. Cory helped me understand why, and even suggested that I put %var% in A and not in B or C (he explained that even without it established within the called macros, as long as it is Global in A, then the macro will run fine). I can do that, it's not a problem. Here are my questions: If all variables are Saved at the end of macro B and all variables are Restored at the beginning of macro C, then why do the contents of %var% remain null in C, even if that variable is not defined in A? I accept that the contents of %var% (as established in macro B) will be lost when the macro returns to A; however, should the Restore command not restore the contents of %var% after they were lost in macro A? If not, can I get a somewhat reasonable explanation as to why not (other than simply "because you should be defining the variable in macro A," please). EDIT As an additional side-note: If B is run independently (not called by A), but A still calls C, then the Restore command within C succeeds at restoring the contents of %var% (as established within B), even though %var% doesn't exist within A. This seems inconsistent to me.
  23. As soon as I read Jason's reply I understood exactly what you were trying to do. I must have had something wrong with my brain when I read your original post.
×
×
  • Create New...