Jump to content
Macro Express Forums

stevecasper

Members
  • Posts

    570
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by stevecasper

  1. My snippets retain the Comment command lines, though they do lose them from the Comment tab within individual command lines.
  2. What exactly is a "breakpoint" on a "Comment command"? I may be misunderstanding your question... Comment commands in ME Pro are essentially just a Remark command from ME3. Its only function, as far as I'm aware, is to give Macro programmers insight about what the following section of Macro code does. If I'm misunderstanding your question (which I have no doubt is the case), please clarify it for me and I'll be happy to try to duplicate your results.
  3. I confirm that trying to reposition and/or resize ME Pro Script editor does not work. The reposition/resize commands themselves work on other windows, but the Pro Editor is apparently immune. I did not have problems with Resize closing windows or freezing ME, however.
  4. Thanks for the reply, Cory... you're one of the most knowledgeable and helpful people on here, so I appreciate the time you give those of us having difficulty with certain concepts. Yes, I realize that, and originally that's all I had, but later realized I would like an array - I deal with multiple account numbers, even when dealing with just one account, so it's good to keep track of primary and secondary account numbers, and an array is a great way to accomplish that. Ok, so I need A to have the variable "available" in order to carry the contents from B to C... it's not immediately intuitive, but it does make sense once you understand that is how it works. Macro A has no 'personal' use for this variable (which is why I didn't originally define the var within it), it just happens to be the 'parent' macro tying Macros B and C together. Macro B's sole function is to grab the account number from the database for use in other macros (Macro A is hardly the only macro using Macro B to gather the account number). Macro C actually needs the account number for use in accessing account information in another application. Another option that might sound logical would be to have Macro C call Macro B right at the beginning of its run, but due to other processes and commands within Macro A between when it calls B and when it calls C, the most streamlined approach is to gather the account number (AKA run Macro B ) at the beginning of Macro A and then hold onto that information until Macro C is called towards the end of Macro A. Unless what you're saying is that by defining the %acctnumber% variable in Macro A, I could still use it in B and C without expressly defining it in those macros? I'll have to test that. But that still doesn't address my "bug concern" (next: ) The "Bug" I think I see is that even when I "Save All Variables" in B and then "Restore All Variables" in C, any variable not expressly defined in Macro A gets erased. I don't have a problem adding the variable to Macro A, it's not a big deal, very simple process... but I am not understanding why the Restore command in C is not restoring the variable to its defined value as saved in Macro B regardless of whether or not the variable exists in Macro A. Global or Local or called by other macro or not... isn't a saved value a saved value? Shouldn't it be restored when the Restore command is used? (and just in case Global/Local does make a difference with regards to Save/Restore - which I believe it does - ALL of my variables are Global... I haven't had occasion to even experiment with Local variables.) That is the possible bug I was wondering about. If it's not a bug, then it's not a bug and there's just a very non-intuitive, possibly incoherent, explanation as to why it isn't a bug.
  5. That's an interesting point. Sadly, I have just run into my original problem again, and there isn't any Save/Restore commands getting in the way... A more accurate representation of the macro sequence is this: Macro A calls Macro B (near the beginning of Macro A) Macro B collects the account number (from an Access database) then returns to Macro A Macro A calls Macro C which accesses a separate application and tries to access the account history (for the account established in Macro B ). I've established Textbox displays at the end of Macro B (showing the account number) and at the beginning of Macro C (display- ing the account number). The named variable is %acctnumber[1]%. I had added this variable to both B and C, but not to A (as discussed earlier, it shouldn't be necessary). However, when the macro reached C, the variable was empty again. I had to add the variable to Macro A in order to get it recognized in C. There was no code between when B returned to A and when C was called that could account for the variable being lost. As I test it, I see that if Macro B calls Macro C, the contents of the variable are not lost, however, if B returns to A and A calls C, then the variable loses its contents (unless I add the variable to Macro A). Here are my test macros that support these findings: Macro A: <MACRO RUN Use_ID="FALSE" Name="Macro B" ID="-1" Wait="TRUE"/> <MACRO RUN Use_ID="FALSE" Name="Macro C" ID="-1" Wait="TRUE"/> Macro B: <VARIABLE SET STRING Option="\x00" Destination="%acctnumber[1]%" Value="123456789"/> <TEXT BOX DISPLAY Title="Account Number - Macro B" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 %acctnumber[1]%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> Macro C: <TEXT BOX DISPLAY Title="Account Number - Macro C" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 %acctnumber[1]%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> Additionally, changing macro B to the following will show that the variable kept its contents when C is called by B, but is gone when the macro returns to A (which then calls C again): <VARIABLE SET STRING Option="\x00" Destination="%acctnumber[1]%" Value="123456789"/> <TEXT BOX DISPLAY Title="Account Number - Macro B" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 %acctnumber[1]%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> <MACRO RUN Use_ID="FALSE" Name="Macro C" ID="-1" Wait="TRUE"/> Keep in mind, the variable in question, %acctnumber%, was added to Macros B and C, but not to A. Adding the variable to A fixes the problem. What's more, after Saving All Variables at the end of Macro B (where Macro B returns to Macro A without calling C), and adding a Restore All variables at the beginning of Macro C, I get the same results as though there were no saved Variable. For some reason, when B returns to A - and A does not contain the variable %acctnumber% - the variable itself ceases to exist, even in the Saved variables file, so that when Macro C runs, the variable is null. If I run Macro B by itself, and then run Macro C by itself, the variable is restored as intended. To summarize: Macro A calls Macro B. Macro B establishes the value of a variable then saves all variables before returning to Macro A. Macro A then calls Macro C which Restores all Variables. The named variable (established in is null, despite having been saved in B and restored in C - most likely due to Macro A lacking the variable in it's own settings. Based on this, I think Save and Restore variables commands are still important and necessary, but potentially bugged. Cory, Terry, et al. (if you are so inclined), can you please duplicate my results and if you don't think it's a bug, please let me know... if you do think it is, please also let me know so I can submit a bug report. Thanks everybody... again !!!
  6. Hey Cory (and anybody else following this thread), I've found the culprit. The problem is that if Macro A sets a variable, and any of the "called" macros have a "Restore" variable within them, then the variable set in Macro A gets "restored" back to null (or whatever it was last time a Save Variable was used with that variable). So, if Macro C utilizes information saved to variables in other macros (as is my case), it therefore requires a "Restore" command. Because that will automatically void the variable set in Macros A and B, I have to make sure a Save Variable is placed at the end of each of Macros A and B. Seems completely obvious to me now, but I guess I was a little confused by the Global check box. I had presumed that making the variable global, it would be automatically "saved" for use within called macros... which it is, as long as Restore Variables isn't used. What a relief to finally understand the problem.
  7. Though you may know this already: A lot of drop-down-type menus will let you type in them and they will skip forward to the menu item you're searching for. So with Macro Express, you just have the macro use the mouse (or Tabs/Controls etc.) to select the menu list, then have the macro type the text of the menu item you're searching for. If that method won't work for the menus you're trying to manipulate, but the menu is static, so you always know how far down a particular item is going to be, you can pre-code your macro to arrow down as many times as necessary for each individual item on the list (which could result in a painfully long bit of macro coding). A quick glance through the suggestion Terry made above leads me to believe that is a better option than the arduous suggestion I just made.
  8. I had very similar (even disconcerting) results. In ME Pro I had slightly better times using Empty over T1="" -> Set T1 to Clipboard (27:45 sec / 100 vs 31:29 sec / 100) However, in ME 3 my Empty time was about 26 sec / 100 whereas Set T1 to Clipboard was done so fast as to suggest it didn't repeat at all. Tested on XP Professional, 512 RAM, 2 GHz Celeron. Weird results. Pretty sure something wasn't right with the Repeat.
  9. Hi Cory, Thanks for dedicating some time to this problem for me. I came to the same conclusion when I had a free minute (and my frustration had subsided). I ran some tests and found that the problem lies somewhere within Macro B (which actually represents a number of different macros, in practice). At some point in my "B" macros my variable was being restored and saved (or something to that effect - I haven't yet been able to locate the exact problem) as a null value. It's nothing to do with Macro Express, but rather a problem with my coding. I've actually started rebuilding the macros from scratch (it's a basic series of about 10 macros (in ME3), which I'm trying to parse out into about 20 new macros in Pro, utilizing more Macro Run commands (for functions occurring in various macros), as well as concurrent macros. The first time through, I mostly just copied the code from ME3 and pasted into MEP, then started picking through and making changes. I thought that would be easier. It was actually very messy. Building from scratch is time-consuming; but it's cleaner, more educational, more fun, and I know exactly where everything is right now as I build it, rather than trying to remember it from months ago when I first built it in 3. Thanks again for all your insight!
  10. Since each individual macro has a Ctrl+R function that allows the ability to replace variables (or essentially anything) within that macro, and to replace all instances of it (which I think is a wonderful function, btw), I was hoping the programmers had made a similar function available to the entire macro explorer as well. I'm just glad it's only a relative handful of macros that I have to make the changes in and not hundreds. And since I've obviously screwed up a number of my macros in other ways, I'm pretty much having to get back into them and re-write them anyway, so as long as I'm there... Thanks for all the help, everybody.
  11. I know... when I started it was just one question, but by the time I finished it was two... but related in context. Sorry, and thank you for taking them both on Bummer The default is Global (if I understand correctly), and I never change the default, so I'd have to say Global. If I'm mistaken about the default observation, I'd love some input so I can make it right. I am, indeed. If I save variables before running Macro B (from within Macro A), and then Restore it within Macro C (also run from within Macro A), does that restore the variable for use in Macro C? I haven't used the debugger in ME Pro, yet. I had honestly only discovered the debugger in ME3 about a month before MEP came out, and didn't find it particularly useful (I usually stick Text Box Displays with the Variables I'm interested in defined in the Display). The Debugger in MEP is far more complex and I haven't bothered messing with it yet. <sigh> I don't know what the problem is anymore. I just built a Macro A B C circuit exactly as the one described previously and it worked fine, even without the variable set within Macro B... and yet, in practice, specifically with an application I use for work, one macro collects an account number from an Access page, stores it to a variable, then runs several other macros - some which need this variable, some that don't - and as long as this variable exists in each macro I don't have any problems, but if it is missing from even one of them, my variable resets to null. Obviously I've missed something. Maybe there is a "Restore" command in one of those macros where the variable itself hasn't been saved. I'm no longer frustrated with MEP as much as I am with myself, now. I guess it's back to the drawing board Thanks for all your help.
  12. Hey all, Maybe this has been discussed (I know versions of problems related to Variable Save/Restore have been), but I think I need a very specific clarification. I have a variable that I originally thought could be established without an array (honestly, I wasn't sure what an array was when I built the macro), and now I have that variable established in about a dozen macros but I want to modify it so that it has an array of [5] (more than I actually need, but now I'm starting to think in the long-run). Do I have to manually go through each of my established macros and modify the properites of that variable in each macro individually, or is there a way to change the variable from the ME Explorer window and have it add/modify the properties of this variable in each macro? Additionally, I'm annoyed by the fact that if Macro A sets variable %AccountNumber% to 1234567890 and then Macro A runs Macro B (which has no use for %AccountNumber% so that variable isn't added to Macro B's "variables list"), and then, after finishing Macro B, Macro A runs Macro C, which does need %AccountNumber, the variable is now empty. It was set in A and C, but since B didn't need it, it wasn't established within B's list, so when Macros A and C come back into play, the variable is now useless. What's the point of having the macro available to be called by other macros called by the macro wherein the variable is established, if it's just going to be nulled out during the play of that particular macro? Ok, so it's annoying, but can be worked around by making sure all the variables set in Macro A before Macro B runs are also added to Macro B's variables list. Kind of a lot of work. Is there any way to copy entire variables lists from one macro to another? I guess what I am really looking for is a way to make it so that when I create a variable in one macro, that variable is automatically added to a list of variables automatically accessible to all other macros (like the default Text/Decimal/Interger variables). Even if "Global" is checked, it still only appears within the macro I created it in. And back to the Save/Restore issue... I'm still unclear how/if this is working correctly. If I set %AccountNumber% in Macro A and save variables after it is set, then use Restore Variables in Macro C before that variable is needed, will it work for me? I know I could test it, but I'm so frustrated with ME Pro right this minute that I've suspended it and don't plan on touching it again for a few hours (I'm sulking) Thanks for any help!
  13. I was able to successfully launch several macros from within other macros using shortkeys, hotkeys, and clipboard events (all activations contained within each of the several macros). It stands to reason all other forms of macro activation can be contained within other macros. This could be problematical. Definitely introduces the need for a new line of thought when building and planning macros.
  14. Hmmm... I see your point. However, I've often had problems with the macro moving so fast (or the source application moving so slowly) that the Copy command is executed before the text is even highlighted. Inserting the Copy command within the Loop allows for the delay in the highlighting of text. Your solution negates the need for a delay after the Copy command, but may require a delay before it. My solution negates the need for a delay before it, and may not need a delay after it. Since the Copy command is being repeated, it should eventually gather information quickly enough - in fact I've never had the loop hang for very long with the Copy inside.
  15. This is essentially what I have built into my macros that need the clipboard to actually copy something before the macro moves on. It is nice in the sense that I don't have to guess how long a delay I need to build, and helps make sure that as soon as the clipboard actually contains information, the macro will continue on (and not until then). It's definitely inelegant compared to a "Clipboard Copy Until <>Empty" command (or something similar) - Sounds like a feature request is needed. Clipboard Empty Repeat Until %T[1]% Does not Equal "%T[1]%" Clipboard Copy If Clipboard Does not Equal "" Repeat Exit End If End Repeat <CLIPBOARD EMPTY/> <REPEAT UNTIL Variable="%T[1]%" Condition="\x01" Value="%T[1]%"/> <CLIPBOARD COPY/> <IF CLIPBOARD Option="\x02" CaseSensitive="FALSE"/> <REPEAT EXIT/> <END IF/> <END REPEAT/> I generally start with a Clipboard Empty to make sure the information in the clipboard is the actual information I'm trying to gather.
  16. Wow Terry, Awesome work. I'll have to toy with that. In the mean-time, I take it there is no actual built-in functionality of Macro Express to do this for us, so - not to undo all the work you and Cory have put into this - I'm going to go ahead and submit a feature request Thanks guys!
  17. I think what he's saying is that when he is on the Create a New Macro window, he is unable to select from the left-hand menu of activations. When he tries to click on any of the selections, the HotKey window automatically selects the mouse-button he's clicking as the HotKey activation. Right Mouse is an authorized Hotkey activation, but Left Mouse is not. You may want to try Left-Clicking the menu selection, even if your mouse is using Left-hand settings (if that is the case you'll probably want to submit a bug report to ISS at www.macros.com/bugreport.htm mentioning this particular issue in particular).
  18. Yes, Macro Express does allow text variables to be set to null values (historically a convenient way to use Restore All Variables and then make sure any values you may not realize were set during a previous macro get cleared before using them in a new macro - not as much of a problem in ME Pro, thanks to the ability to name variables).
  19. It's not really clear what you're trying to accomplish with your macro. If you navigate to the same page manually, do you get the same website identification? If so, how do you manually get past it? Just duplicate your manual actions with Macro Express commands. If not... well you haven't really given us much information to work with.
  20. I think I've hijacked your thread. Sorry, Terry Clearly the problems I have when not using the Wait for Text Playback stem from a memory issue of some kind. When I add the command after the text, then I have no problems with gibberish (ran the Small Quantity 209 repeats without incident). I imagine it isn't built into the command because computer memory can handle quite a bit of text before getting confused, so unless you're doing something ridiculous like my tests, or typing out large volumes of text all at once, the wait is probably not necessary. However, since occasions will obviously arise where large volumes are being typed out, the Wait for Text command exists to facilitate those instances. Still doesn't explain the problem you are having, though. I am unable to duplicate it on my machine. I ENTERed down a bunch of lines in my Notepad, then set my cursor to the top and wrote this command (practically identical to your example). The Arrow Down executed once, and the macro was done. Text Type (Simulate Keystrokes): <ARROW DOWN> Wait for Text Playback
  21. As a Third Edit, but in a new post: The error occurs with small strings of text as well: Window Activate: Untitled - Notepad Variable Set Integer %N[1]% to 1 Repeat Start (Repeat 500 times) Text Type (Simulate Keystrokes): Here is test number %N[1]%. And a Small Quantity of Text. Done %N[1]% Variable Modify Integer %N[1]%: Increment End Repeat Wait for Key Press: ENTER I had to increase the Repeats to get the error, but it hit at about Repeat 86: Also, as a side note: The Wait for Key Press: ENTER command doesn't work, even when I don't get this gibberish error. With a repeat of only 50, the gibberish never happens, but the running man is gone by line 18. In fact, if I place the Wait for Key Press: ENTER inside the repeat loop, it is not recognized and the repeats just go along as though the wait doesn't exist. If I put the Wait before the Repeat, it works, if I put it just after the Repeat Start, then it works on the first pass, but no any additional passes. Any other location within the repeat gets ignored completely. This I can report as a bug. -reported-
  22. I'm not able to duplicate the problem you describe. Honestly, I've never used delays or Wait for Text Playback before, because the wait seems to be built in, making the command itself superfluous. However, in fairness to your problem, I built the following very simple macro: Window Activate: Untitled - Notepad Variable Set Integer %N[1]% to 1 Repeat Start (Repeat 15 times) Text Type (Simulate Keystrokes): Here is test number %N[1]%. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. And a Large Quantity of Text. Done %N[1]% Variable Modify Integer %N[1]%: Increment Wait for Text Playback End Repeat It repeated all 15 times without fail, and finished after the 15th iteration. However (notice the stress), when I disabled the Wait for Text Playback command I got one of the strangest errors I've ever seen. Iterations 1, 2, and 3 each typed out perfectly, but here is what 4 looked like: All the rest look like that gibberish, too (without the successfull first couple of lines). This isn't the first time I've seen this error in ME Pro, but it is the first time I've mentioned it (I don't remember exactly what I was doing when I got it the first time, but it was something similar to this). I'll try to duplicate it a couple of more times then edit this post estimating the rate of recurrence. EDIT Ok, after 5 tests, I received 100% failure at approximately the same point in the macro. Several lines into Repeat number 4 the gibberish starts up. On test number 3 I noticed the Running Man icon disappears at approximately Repeat number 5 (hard to say exactly). I presume that is because the macro continued to play out and finished "typing" faster than Notepad could keep up, which resulted in the running man disappearing at the end of the macro rather than at the end of the typing. This is supported by a 6th test where I right-clicked the running man during Repeat 1 and the text continued typing until reaching some point near the end of Repeat 2. EDIT 2 Well, for a 7th test I added a Wait for Key Press: ENTER at the end of the script, to keep the running man up until after the entire macro had run and then keep it running until I decided it was finished (this to test my theory from the previous Edit. No joy. He disappeared at about Repeat 5 (-ish), and when the repeats had completed, the macro was done, no need to press ENTER. This is a messy bug to report, because I'm not exactly sure what to say If anybody else is able to duplicate this problem, please let me know.
  23. When I saw this I was stunned. I've never seen an "On Error" option, and after scouring ME3 and finally just copying your code into an editor I realized something: It's not available in ME 3. Another reason to upgrade to ME Pro, because this On Error command is awesome (How did I miss its existence in Pro till now?)
×
×
  • Create New...