Jump to content
Macro Express Forums

paul

Members
  • Posts

    1,049
  • Joined

  • Last visited

Everything posted by paul

  1. Please try this and let me know how it compares with a "pure" MEP solution. I'm using AutoIt to do the select and delete operation. Create a macro, activated with Ctrl + Shift + Left Arrow, activated as soon as the keys are pressed. <EXTERNAL SCRIPT Language="AutoIt" Dest="%tOutput%" Script="Send(\"^+{LEFT}{BACKSPACE}\")\r\n\r\n"/>
  2. Shirt on! Bingo! The "don't wait" setting indeed appears to mean that the called macro has no access to existing variables. Insight could certainly have used better wording for this, but there you are.
  3. "m2 doesn't even start". Why on earth not? If m1 calls m2, of course m2 will start. The purpose of my example is to demonstrate exactly when m2 runs "stand-alone" (i.e. no variable values from the calling macro are available) and when it runs "as part of" m1 (all m1 variable values are available in m2). I thought is was pretty clear. As I stated elsewhere, I suggested using F8 to run m1 simply to allow you to see m2's messages in the correct sequence. If you run m1 normally, the sequence of m2 messages may appear to be in the wrong order. I was merely trying to make it easier for you to understand. Apparently, I failed!
  4. Using F8 does not produce different results! In this case you need to use F8, otherwise you cannot distinguish between the two calls to m2, since m1 isn't waiting for m2 to finish in one of its calls. I could have inserted logic to handle that but didn't think it was worth the candle!
  5. Wrong! - By default, each macro defines 4 array variables of 99 elements called C, D, N and T which are available to called sub-macros. So both macro1 and macro2 "contain" these variables - Because macro2 is independent (although it's called by macro1, macro1 does not wait for macro2 to complete), its variables come into existence only when it starts (whether as a result of you running it, or being called by macro1) - If macro2 is called by, say macro3, where macro3 does wait for macro2 to complete, then in this instance macro2's variables first come into existence when macro3 starts and are therefore shared Take a look at this example: Macro m1 Variable Set String %T[1]% to "qwerty" Text Box Display: m1 (displays the value of %T[1]%) Macro Run: m2 (do not wait for m2 to terminate) Macro Run: m2 (wait for m2 to terminate) Macro m2 Text Box Display: m2 (displays the value of %T[1]%) Run m1 from the script editor using F8. You will see 3 text boxes containing the value of %T[1]%: The first box shows qwerty The second box shows blank The third box shows qwerty Do you follow?
  6. In my former job I was using MEP and Remote Desktop all the time, and discovered odd behaviours I could never properly explain. Here's an example: MEP is running on both local and remote machines. I have a macro that I want to run on the remote machine if that machine's window is active, otherwise run it on the local machine. It's activated on both machines by Ctrl-G. It determines whether the remote session is active (i.e. the foreground window); if no, then the macro processes locally in the normal way. If yes, then all the macro has to do is Type Ctrl-G, and, somehow, the remote machine's macro runs. This technique works in 95% of key combinations, like Ctrl-G, but the key combinations cannot ever include the Windows key (having a macro type such a combination never invokes the remote macro, irrespective of what RDP settings are selected).
  7. If using Windows 7's Backup utility, make very sure that you are able to restore from it. Unknown to me, Windows 7 scheduled a backup job to run weekly. My backup media is external and therefore not always available. When Windows 7 tried to run the scheduled backup, the external media drive was unavailable, and my entire backup catalog was corrupted, to the extent that the backup I had made earlier was useless.
  8. I get exactly the same result as you. CALC.EXE gives the error message while another .exe does not. And terminating Calculator using the window name also gives no error message.
  9. Agreed. It's exactly the sort of sloppy programming I'd have expected (not properly testing fringe conditions), so it's disappointing that I'm not disappointed!
  10. I'm fascinated to know why you find this so?
  11. MEP produces -9.5 when asked to round -9.60000000000001 to a single decimal point. This answer is simply wrong - the correct response is -9.6. You should report this as a bug.
  12. But you need to be aware that if you are logged out (i.e. you need to retype your password when the machine wakes), many/most macros will not run. In which case, there is a separate technique that can be used, where the computer is automatically rebooted to login without having the user type a password, then runs the scheduled macro, then reverts the computer to requiring a user login, and finally returns to computer to its sleep/standby/hibernate status.
  13. This rings so many alarm bells! I think you'll find that floating point operations (which I assume the Decimal variable is prone to) often result in these types of inexact results - I can remember similar problems in Microsoft Access and VB. If I'm right, then there's nothing Insight ca do for you. For more information, see: Floating Point 1 Floating Point 2
  14. You can concert a string variable to decimal, then the decimal variable to date/time. Does this help?
  15. I can think of arguments both ways: - the argument in favour of not being allowed to run a disabled macro is self-evident - but do you really want the action of disabling a macro to affect other macros that call it? On balance, I think Insight has made the right decision (though it could just as easily be an oversght on their part!).
  16. One final contribution from me: I think your English is letting you down badly here. The point of outlining the concept to you was not to show you that I understood your concept, but to try and persuade you to think about your puzzle from a new angle. Nowhere in my outline is there any suggestion that you have to determine "all combinations within a set of elements"; indeed, it is this very notion that is causing you all your problems. Your insistence on calculating all combinations is exactly what is leading you astray. In which case I think you're on your own because you do not appear at all receptive to other suggestions. This is why I prefixed my text with the words:
  17. My intention was to suggest an entirely different way of designing your macro(s) as I believe that the code you have written with the multiple nested Repeat loops has no chance of being visible (and therefore viable) in the way you want. In fact, display of this code has caused me several problems, some of which have caused ME to crash. So if my idea is useful (and you have indicated that it is), then I think you should abandon the approach you have adopted, and redesign and rewrite your macro using the logic I outlined.
  18. Ah, a mah-jong player perhaps? Are you any good? Suppose a 2-row array of these values: 100 1000 21 8810 A numeric array will correctly sort these rows as 21 8810 100 1000 while a string array will produce the opposite. Mind you, using Macro Express you can force all pixel values to be zero-filled to the left and 8-characters long, in which case strings will work fine. For an outstanding sort utility, take a look at this: RpSort (FYI I came across this utility in the early 1990s, and corresponded briefly with the author. A little while later the utility was published in a slightly different way - in fact, by his brother after the author's sudden and very untimely death.) Does this mean you have sufficient information now to resolve your problem?
  19. Does this work as a concept (don't let's worry about the implementation at this stage)? - Create an array of n rows by 200 integer columns (where n is the number of rows you will process). - Populate the array with the pixel values - Sort the array - Eliminate duplicates (do you need to remember eliminated line numbers?) - Process the array to determine the smallest number of elements that render each line unique - Create output Is this useful?
  20. I attach "code" that you should use to create a macro that finishes only when Firefox's toolbar X reverts to its normal loaded state (or after 100 iterations in case the site never loads). You'll probably have to change the pixel values in lines 8 and 12, and perhaps the location too in line 7. You should be aware that in some circumstances Firefox is still not ready to continue even when the X has reverted. This explains the code from line 19 onwards: if the calling macro needs this macro to wait extra time, it specifies the number of seconds to wait in the allocated registry value. If you want to use this feature, you'll need to allocate a value at an appropriate location in the registry, and change the code in lines 19 and 23 to reflect that revised location. If Not Program "FIREFOX.EXE" is running Macro Stop End If Window Activate: Mozilla Firefox // Check X, wait until not red Repeat Start (Repeat 100 times) Get Pixel Color at (140, 66) Relative to Current Window into %N99% If Variable %N99% Equals "13128728" Delay: 250 milliseconds Continue Else If Variable %N99% Equals "10791339" Repeat Exit End If End If Macro Stop End Repeat Delay: 1 seconds Read Registry Value "HKEY_CURRENT_USER\Software\Professional Grade Macros\PhtData\FirefoxAfterLoadDelay" into %N99% If Variable %N99% Is Greater Than "0" Delay: %N99% seconds Variable Set Integer %N99% to 0 Write Registry Value "%N99%" into HKEY_CURRENT_USER\Software\Professional Grade Macros\PhtData\FirefoxAfterLoadDelay End If
  21. Thanks for providing your detailed and very interesting description. I don't follow here. How are the 3rd (3 4 5 2) and 4th (4 5 1 3) lines the same as any of the others? I can see that lines 1 and 2 contain the same numbers, whereas lines 3 and 4 are both unique. What am I missing? And I don't understand the output. WHat are the 6 pixels in each line formed from?
  22. How could anyone (including you) ever successfully debug this script? If you are able, using simple English, to describe in detail what this macro is supposed to do, I imagine there would be a better way of achieving your goal. In fact, I seriously doubt if any of us could find a worse way!
  23. Alternatively, you can create an operating system scheduled task to run the following command daily at a certain time, or once, or weekly on certain day(s), etc. This method offers more capabilities, e.g. wake the machine up to run your task (but you may need to create an automatic login procedure): QualifiedPath\Meproc.exe /AYourMacroName where QualifiedPath is the fully qualified path to Macro Express, e.g. "C:\Program Files\Macro Express"
×
×
  • Create New...