Jump to content
Macro Express Forums

stevecasper

Members
  • Posts

    570
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by stevecasper

  1. I just tested it and it looks like when you have two windows open with identical names, it will go with which ever one was the one most recently "Active." I opened two notepads, then ran the macro. The window that took the "Hide" command was the second notepad. The first one just sat there. So the window that got hidden still took precedence when the macro activated notepad, and so the hidden window took the text as well. I tried having two separate "Hide" commands, so that both notepads would be hidden, and that worked fine. Only one of the notepads took the text (the first one opened, this time, since it became the "Active" window when it was hidden - the second notepad opened being the first to be hidden). At the end of the macro I set two "Show" commands, but only the notepad that had taken the text reappeared. In fact, I couldn't get the blank notepad to reappear until I closed the one that was visible. So that's kind of a problem. Not sure how to work that out without some obnoxious work-around command-builds.
  2. Ok Terry, I just ran your code on my machine at home, and it completed in 4:26 seconds. Interestingly enough, when I ran my code ("Macro Express Rules" 100 times), it completed in 3:84 seconds. Obviously there will be some discrepancy based on my own reaction times, but both instances are pretty dern fast. When I switch to using the clipboard to paste, my 100 repeats took just over 52 seconds. Yours, set to paste, took just over 8 seconds. It's strange that your computer takes so much longer than mine, when our specs are virtually identical. Unless Vista really is that much better than XP...
  3. Terry, I'm at work now (work PC is a joke), but I'll be happy to try it as soon as I get home (couple hours). It looks like our systems are pretty close to identical (I'm running Vista Ultimate 32 bit is the only obvious difference I see). I was estimating the time it was taking to run the macro. Typing it "normally" was screaming fast, though. And using the paste function was so unbearably slow that I actually thought the macro had hung up on something, till I ran it on a visible notepad (so I could see that it really was doing the job, just slowly). Anyway, I'll actually time it and let you know what I find out once home.
  4. Yes, this can be a little bit of a problem. What I would do is create a second macro that is nothing more than: Window Show: "specific window" That way if your window gets stuck hidden, you can un-hide it pretty easily. What I was doing with mine, was actually just changing the Hide command to a Show command, and then running the macro again. Either way will work.
  5. Hey Terry, Yeah, I had a similar problem. I stuck with the "Macro Express Rules" text and had it type 100 times on the hidden notepad, then I periodically clicked on an open word processor page (I used OpenOffice.org Writer, but I don't think it would make a bit of difference if I used Word or Word Perfect), and the macro continued running, it just happened to finish typing the 100 "Macro Express Rules" into the .odf document. So I modified the macro to have an "If/Else" clause. Essentially: If notepad active Text type ME Rules Else Activate notepade Text type me rules End if This worked better, but whenever I clicked into the .odf document there was a chance that the macro would already be within the "If/Else" clause. Sometimes it worked, but mostly it messed up a little, then went back to the notepad to continue. For most practical applications that I can think of, if you mess up a little bit, you've pretty much messed up the whole thing. However, it could be useful under certain circumstances... just none that I can think of specifically (beyond reading a blog, news page, etc. where you don't need to be clicking till after the macro has finished running). Still, I love playing with macros, so experimenting with this task has been enjoyable. PS - I've noticed something in the past, but haven't thought twice about it till now. When using Clipboard to paste in Text Type, it is considerably slower than having the text typed out normally. The above macro ran in about 5 seconds (give or take) when typed normally, but took as long as a minute when using the clipboard function. Is that because when using the clipboard function in the Text Type command, it is actually using a Ctrl+C type process, including all the pre-set delays within Macro Express? I had always assumed that using this function would be faster than typing normally (and I imagine it is faster when dealing with extaordinarily long bits of text), since I thought ME just took the information and pasted it in it's own right. But it is obviously much much slower, leading me to suspect it is using the outside clipboard to save/paste. Would manually reducing the delays increase the speed of text-type processes using the clipboard? Not that I necessarily would... clipboard commands need those delays, in my opinion (my work PC sucks), I'm just curious.
  6. I'm not sure what a "modal" message window is, but you should be able to build a macro that can handle them. You just need to know what the message window's name is, then you build this script: Window Close: "specific window title" <WCLS:specific window title> Just set the macro to activate based on the Window title, and that should make it so that any time the window that you don't want is activated, this macro will run and close it. If several of the same window are popping up at the same time you may need to modify it a little bit: Repeat Until %T1% <> %T1% If Window Title "specific window title" is running Window Close: "specific window title" Else Break End If Repeat End <REP3:08:000002:000001:0001:1:01:T1><IFOTH:04:2:specific window title><WCLS:specific window title><ELSE><BREAK><ENDIF><ENDREP>
  7. Ha Ha!!! So I just tried another little experiment that worked surprisingly well. Still don't know if this will work 100% for what you need, but it is definitely something to check out, IMHO. It has to do with hiding the window. This worked perfectly. (I have the hidden window re-appear at the end of the macro, for simplicity, but I didn't originally... the text type happens while the window is still hidden.) Window Hide: "Untitled - Notepad" Activate Window: "Untitled - Notepad" Text Type: Macro Express Rules Window Show: "Untitled - Notepad" <WHIDE:Untitled - Notepad><ACTIVATE2:Untitled - Notepad><TEXTTYPE:Macro Express Rules><WSHOW:Untitled - Notepad> Now, depending on how much you have going on in the "hidden" window, if you end up clicking a different window, you may change the focus, screwing up your macro... but that will take a bit more experimenting.
  8. Here's the rough work-around I put together. I also thought about having the window momentarily gain focus, which would be mildly annoying, but sometimes you do what you have to do... but then I thought about hiding the window before activating it. I tested it on Notepad and also on Internet Explorer, and it seems to work. The only problem is deciding at what point to unhide the window. Here is my little test macro: Window Hide: "Windows Internet Explorer" Activate Window: "Windows Internet Explorer" Text Type: <F1> <WHIDE:Windows Internet Explorer><ACTIVATE2:Windows Internet Explorer><TEXTTYPE:<F1>> If I were going to just have the window activate, then go away, I would probably do something like this (depending on how fast your system is, this could go very quickly... on my computer (Vista 32, 4GB RAM, Intel Quad 2.6 GH, it screams, I hardly notice the window activating; whereas my work computer is XP Prof, 512 RAM, P3 or low-end P4, I can imagine it taking as long as a whole second depending on how many other processes are running): Activate Window: "Windows Internet Explorer" Wait For Window Title: "Windows Internet Explorer" Text Type: <F1> Window Minimize: "Windows Internet Explorer" <ACTIVATE2:Windows Internet Explorer><WAITWIN2:000010:000000:Windows Internet Explorer><TEXTTYPE:<F1>><WMIN:Windows Internet Explorer>
  9. Of course, the very specific thing you mentioned can be done, though it's certainly not what you actually intend to do. Repeat Until %T1% <> %T1% Repeat Start (Repeat 1000 times) Variable Set String %T1% "b" Variable Modify String: Append %T1% to Text File Repeat End Delay 5 Seconds Repeat End <REP3:08:000002:000001:0001:1:01:T1><REP3:01:000001:000001:01000:0:01:><TVAR2:01:01:b><TMVAR2:20:01:00:000:000:C:\Users\Steven\Documents\Macros\Macro Test Files\appendtext001.txtF><ENDREP><DELAY:5><ENDREP> This will cause Macro Express to add the letter b to a text file 1000 times, then wait 5 seconds before doing it again. It's set to run forever (or until canceled). While it is doing this, you can use your computer as you wish, but you won't be able to use any other macros. As far as I can figure, it is a completely pointless macro. I understand your example was simply to give an idea of what you want to do, but I hope that my response to your example can help you figure out a work-around for what it is you want to do (or help you come up with an idea of something similar but different, that you can figure out or we can help you figure out how to do).
  10. Add this code after the else (before or after the delay is up to you): Variable Modify Integer: Inc (%N1%) This command will increase N1 from whatever it started out as by 1. Once N1 = 34 your repeat will end (as indicated in the Repeat Until command. You'll probably also want to add a Variable Set Integer %N1% to 0 or 1 before beginning the repeat. I hope this answers your question. If not, I misunderstood and would be happy to take another crack at it. PS The key combination for pausing your macro mid-run is going to depend on your preferences. You can check it by selecting: Options -> Preferences -> Playback I have personally never found any use for the "pause" function like that. For debugging, I generally throw a Pause Command into the macro itself or use a Text Box Display to help me locate trouble-spots, then once I'm convinced the Macro is Working right, I either delete it, or de-activate that command (don't forget to save). Based on the info in your post, I would build my macro to look like this: Variable Set Integer %N1% to 1 Repeat Until %N1% = 34 Mouse Move Screen 123, 123 Get Pixel: Under Mouse into %N2% If Variable %N2% >= 1000 AND If Variable %N2% <= 1005 Text Type: <F2><F3> Delay 60 Seconds Else Delay 20 Seconds Variable Modify Integer: Inc (%N1%) End If Repeat End Here's the direct editor script <IVAR2:01:01:1><REP3:08:000001:000002:0001:0:01:34><MMS2:123,123><GETPXM:2><IFVAR2:2:02:5:1000><AND><IFVAR2:2:02:6:1005><TEXTTYPE:<F2><F3>><DELAY:60><ELSE><DELAY:20><NMVAR:08:01:0:0000001:0:0000000><ENDIF><ENDREP>
  11. Kevin, you rock! Thank you for explaining the :01: ... and for all the clarifications! I generally am not happy with "it works because it works" explanations, so I try hard to figure them out on my own. But I still sometimes reach a point where my experiments and experiences stop helping me piece the puzzle together without a little nudge from the people who really know it. Thank you for the nudges! I feel smarter already
  12. I'll try to clear this up as much as possible, since it's my suggestion that is causing confusion. Some of this is very basic Macro Express code, though, so please bear with me. This post is going to be rather long, and specific. Terry is right, the Help files really are a good reference for figuring out the most basic commands. But I also like a challenge and I enjoy explaining ME in detail, because I often find that as I do so, I learn things I didn't know before (sometimes I suddenly understand why something works that I didn't understand before, even though I use it). An integral part of ME is the storing of information on "hooks" called variables. There are three basic types of variables in ME: Text Variables (indicated by a T), Integer Variables (indicated by an N), and Decimal Variables (indicated by a D). Each type of variable can have up to 99 possible hooks per macro. So, you can have Text Variables ranging from T1 through T99; you can have Integer Variables ranging from N1 through N99; and you can have Decimal Variables ranging from D1 through D99. Your indicated list consisted of "red white and blue." Assuming the list is in a list format: red white blue the macro I built for you would start your list by assigning red to T10, then it would assign white to T11, and finally it would assign blue to T12. The macro would work for longer lists as well, up to T99 (89 possible lines of text, since it started at T10, not at T1). You don't need to know Direct Editor script to make this work. I don't even begin to understand Direct Editor script. I just happen to know one particular function for building a macro into a text file that will do what it is you need the macro to do. I explained that in as much detail as I understood in my previous post. I also provided the Scripting Editor text in that post, so you can see what it looks like in the Scripting Editor (what you copied into this reply is the scripting editor text). The problem with running a macro from a Text Variable (which is what you have to do to make my macro work), is that the macro inside the Text Variable has to look like Direct Editor script. It's the only way. I looked for a long time before figuring that out about a year ago. The thing is, you don't really need to understand Direct Editor script. You just need to understand what each part of that command means. I tried to explain that in the original response, too. I don't understand more about it than I stated, but it should be enough for you to duplicate it in your own macro, depending on your needs. I will repeat the explanation of each step of this macro, and try do be more specific about what each step means. Step 1: <IVAR2:01:01:10><BTFBEG:001:000001:000000:C:\Users\Steven\Documents\Macros\Macro Test Files\textfileprocess001.txt><TVAR2:02:01:<TVAR2:%N1%:01:%T1%\s>><RUNMACVAR:2><TBOX4:T:1:CenterCenter000278000200:000:Text File Process 001T10 = %T10% T11 = %T11% T12 = %T12%><NMVAR:08:01:0:0000001:0:0000000><BTFEND> But in the scripting editor it will look like this: Variable Set Integer %N1% to 10 Text File Begin Process: "textfileprocess001.txt" Variable Set String %T2% "<TVAR2:%N1%:01:%T1%\s>" Run Macro in Variable %T2% Text Box Display: Text File Process 001 Variable Modify Integer: Inc (%N1%) Text File End Process
  13. I don't, sorry. I use Microsoft mice. And even the mouse I'm using now is basic and so I don't even have the Intellimouse drivers installed to see how flexible those drivers are.
  14. This is true. However, if you have the appropriate software for your mouse, I believe you could simply re-program the mouse button of your choice to the key of your choosing.
  15. I think you've just about got it. What you'll want to do is one of two things: 1) This will ensure the macro runs over and over ad infinitum until you manually cancel it: Repeat Until %T1% <> %T1% If Ping Successful: "www.yahoo.com" Else Web Site: http://www.jackalwireless.net/hotspot/index.php [Default Browser - Wait to load] // Here you you will put your macro commands to log you back into your service. End If Repeat End <REP3:08:000002:000001:0001:1:01:T1><IFPING:00005:www.yahoo.com><ELSE><HTTP2:1:T:http://www.jackalwireless.net/hotspot/index.php><REM2:><REM2:Here you you will put your macro commands to log you back into your service.><REM2:><ENDIF><ENDREP> By telling the macro to repeat until %T1% does not equal %T1% you're essentially telling the macro to repeat forever, because T1, obviously, will always equal T1. 2) Or you could drop the Repeat altogether and just set the "If/Else" statement macro to activate on a schedule (rather than with a hotkey or shortkey. Set the schedule for every, say, 5 minutes between the hours of 6:00am through 9:00pm (or indefinitely). If you stick with the Repeat option, you might want to add a Timing delay before the Else command, otherwise the ping will go out very rapidly as the macro repeats. This may or may not affect your performance (I honestly don't know). As far as the "Else" being triggered, even when the Ping should have been successful, you may want to consider increasing the If Ping Successful maximum time to wait (the default is 5 seconds, but maybe 15 seconds would be better for your situation).
  16. I've built similar macros for my mother-in-law and my wife who both work from home and don't have a programming bone to share between them, but Macros make their lives so much easier. Their job function is such that they need to create new macros that are essentially identical to all the others they use, just with different contents, and for sanity reasons (not to mention travel to go to my in-law's) it made more sense to build a macro that they can run which will gather what is needed for the new job-macro. The only way I've been able to do it, and possibly the only way at all, is to have the macro go through the same steps you would normally go through manually. I just make sure that they are aware that once they have put in all the information and the macro is being built, they don't touch anything. In fact, I have a text box pop up asking them not to touch anything until the window disappears. If there is a way to have a macro be built secretly in the background, I'm not certain it could be done with ME alone. But I'm not completely positive. Anybody else have any ideas?
  17. I think you said you did this, but I want to be clear: Text Type: <CTRLD> Mouse Left Button Click Text Type: <CTRLU> <TEXTTYPE:<CTRLD>><LCLK><TEXTTYPE:<CTRLU>> If so, you might want to provide more information about your system, as there may be a compatibility issue. You may even need to contact Insight Support. I can't think of any function I have on my system where Ctrl+LMB is used, so I can't test the functionality to make sure it's working on my computer.
  18. I like it. I'm not particularly proficient with ACII Characters at this point in my macro-life, so I'm uncomfortable enough to not attempt them when trying to help other people, and yet this particular solution is, indeed, elegant. I just compared it mentally to the process I mentioned in my last post (the file that required 20+ variables), and I don't see any reason why this method would not be equally effective. In some ways it would be more effective: You wouldn't need to start at T10, for one thing. However, it may be less effective in other ways: If your list was made up of lines of text which include commas, for example, I'm not sure how that would effect the process. I guess that could be fixed by adding a bit more code: An "If Variable" statement such as "If Variable %T1% contains ',' then Replace ',' with '","' in %T1%". Like this: If Variable %T1% contains "," Replace "," with "","" in %T1% End If <IFVAR2:1:01:7:,><TMVAR2:21:01:00:000:000:,","><ENDIF> And this would need to be done before replacing %T95% (the CRLF) with "," (otherwise you'd screw up the whole thing). At least that's how I imagine it would work. Haven't tested my theory yet, but it looks right to me. Heck, you could probably just do away with the "If" statement altogether. If your text already has commas in it, you probably want them there, so drop the "If" statement and just throw in the Replace code.
  19. Hey Terry, The simplest solution is often the best, and the most intuitive, too. I originally had a macro that was very similar to the example you give, but it was insanely cumbersome for what I needed. As you point out, the simple intuitive method isn't practical for longer files. I was processing a file of over 20 lines, each needing it's own variable. The macro was unbearably long. Discovering the Run Macro in Variable command smoothed my code out too sweetly not to share it whenever I can (I just wish I understood more of the Direct Editor code. That would, I'm sure, expand my ability to really make my macros sing and dance.) I haven't tested Namino's method yet, but I'm going to very soon. I always prefer elegance to cleverness in my macros.
  20. Are you trying to assign the colors to the Text Variables? Or just the words "red", "white", and "blue"? To assign colors, you may need to assign the hex number for the colors to the variable... but I'm not completely sure that's what you're actually trying to do. If, instead, you have a text file that looks like this: red white blue and you simply want your variables set up as: "%T1% = red", "%T2% = white", and "%T3% = blue", then the answer is simple in an advanced, and sort of complicated way: Variable Set Integer %N1% to 10 Text File Begin Process: "textfileprocess001.txt" Variable Set String %T2% "<TVAR2:%N1%:01:%T1%\s>" Run Macro in Variable %T2% Text Box Display: Text File Process 001 Variable Modify Integer: Inc (%N1%) Text File End Process <IVAR2:01:01:10><BTFBEG:001:000001:000000:C:\Users\Steven\Documents\Macros\Macro Test Files\textfileprocess001.txt><TVAR2:02:01:<TVAR2:%N1%:01:%T1%\s>><RUNMACVAR:2><TBOX4:T:1:CenterCenter000278000200:000:Text File Process 001T10 = %T10% T11 = %T11% T12 = %T12%><NMVAR:08:01:0:0000001:0:0000000><BTFEND> First I created a .txt file that is simply: red white blue and I saved it to my C: drive (I have a folder specific for testing macros). This macro does the following, step by step: Sets N1 to 10 (this will cause your list to start on %T10%... for some reason I've found that this kind of process tends to fail if you start with a single digit Text Variable, and advances into double-digits, so I recommend starting no lower than T10). Then you begin the text file process which scans your saved .txt file and places the first line into the selected variable (for simplicity's sake I have put mine in T1). Next I create a macro within a variable (this is the part that says: Variable Set String %T2%"<TVAR2:%N1%:01:%T1%\s>" ) There are a lot of resources about this... I don't understand the half of it. However, I do know that this process works. I put my macro within the text variable T2, and here is what that means (as much as I understand of it, that is): TVAR2 is code for "T" or Text Variable. %N1% indicates the value within N1, in this case N1 = 10, so "TVAR2:%N1%" is code for "%T10%". :01: = I have no idea %T1% is the code telling this macro what value to assign to %T10%. So, in other words, the macro within %T2% will assign the value (contents) of %T1% to %T10%. Hence, when I run my process for the first time, T1 will be "red", then the macro within T2 will assign "red" to T10. At this point, the macro within %T2% is created, but has not yet run (this "macro within T2" could technically be set at any previous point in the macro, I just happened to put it immediately prior to the code that runs it... the next step). Now I run the macro that I put within variable T2. At this point, my test macro will open a text box which gives me a running commentary of where I am in the process (completely optional, but useful for debugging). Next, I increment the variable N1. Because N1 was originally equal to 10, I want the next item on the list to be assigned to T11, not T10... otherwise what was the point, right? So I increment N1 from 10 to 11. Finally, I end the text file process, which is similar to a Repeat End command in that it starts the process over on the next line in the text file and will continue doing so until the list has been completed. Clear as mud? If any of this made sense to you... you're either way smarter than me, or I'm better than I thought. If you need clearer explanations, please don't hesitate to ask. I can try to do better, or (hopefully) somebody who is way smarter than me can do a better job of explaining it.
  21. Very Interesting. I have the same problem. I just built a very simple macro that when I run it, it should mute my system. But it is not working. Here is the macro... get ready: <AUDMUTEON> I'm running Vista 32, sp1. Macro Express version 3.7d (3.7.4.1) Did I miss something, or is this particular function not functioning correctly?
  22. This is what I'd recommend, too, but that will only work with IE (and even then it sometimes doesn't work right with IE 7 + Vista 32 - possibly other systems, as well, but I've never had a problem with IE 6 + XP Prof, nor IE 7 + XP Home with SP2 or SP3). If you don't use IE, the next best thing would be "Wait for Window Title to Appear".
  23. You are right on what to do. Here is how: // When you have the reply window open, set the variable to the Window Title Variable Set String %T1% from Window Title // Do other stuff with your macro // When you're done with the other stuff, recall the Variable you set to the window title Activate Window: "%T1%" Here is the Direct Editor Script <REM2:When you have the reply window open, set the variable to the Window Title><TVAR2:01:06:><REM2:Do other stuff with your macro><REM2:When you're done with the other stuff, recall the Variable you set to the window title><ACTIVATE2:%T1%>
  24. I, too, would like to know more about writing to the registry without messing up my system.
×
×
  • Create New...