Jump to content
Macro Express Forums

paul

Members
  • Posts

    1,049
  • Joined

  • Last visited

Everything posted by paul

  1. I don't follow. DId you change the number of array elements at run time or design time? If at design time, what advantage did Get Array Length offer other than avoid having to look at the Variables tab to see the array length?
  2. I think you're right. Quite honestly, I can see absolutely no point in the Get Array Length command. Since arrays have to be declared at design time together with the number of elements, what does Get Array Length do that is at all useful? I'd have hoped that the Split command could dynamically assign the number of elements it needs, but, sadly, not. What am I missing?
  3. The documentation states: Can anyone provide an example of changing the number of elements without modifying the macro script please? This sentence seems to imply that the number of elements in an array can be changed at runtime. How?
  4. On my machine, Win+M seems to minimize only the windows on my primary monitor, while WIn+D minimizes or restores all windows. It works in the same way for me as for you. What about allowing the macro to fire when the desktop has the focus, and then determining if all windows are minimized, and if not then exiting without doing anything? That ought to be possible via an AutoIt dynamic script. I must confess that I shudder when I hear about, or see, people using wallpapers. Have you any idea how many resources that uses? No wonder people complain about their slow machines!
  5. Well, in Windows 7 (and probably in XP too), I can have one window visible (i.e. all others are either not loaded or minimized). I can click the desktop and the one visible window is no longer the focused or active window. So your "i.e. when I have..." statement should probably read "e.g. when I have", which of course is quite different in meaning. I have defined a macro with its scope set to Program Manager (The window must be on top, and The title is an exact match) and its hotkey fires only when no window has the focus, so it seems to work the way you wanted.
  6. I'd do it rather differently! Clipboard Paste Wait for Window Title: Confirm File Replace -- wait 1 second On Error Catch Error: The condition was not met within the specified amount of time -- i.e. the file did not already exist Goto:CopyDone End Catch Error End Error Text Type n -- this line executes only if the file does already exist :CopyDone FYI, be aware that the Windows 7 experience is quite different - you'd need to wait for a different window title (Copy File), and you'd use this code to replace the Text Type n line Text Type (Simulate Keystrokes): <ARROW UP><ARROW UP><ARROW UP><ENTER>
  7. There's no mystery in this. A VM environment is, to all intents and purposes, exactly like a normal environment on a normal machine. So, of course, ME runs on a VM exactly as it does in a normal environment. The thing to remember is that the host machine cannot communicate with any applications running on the VM (it can't see them and has no knowledge of their existence - to the host, the VM is simply an application; i.e. a black box) unless the VM application can react to newly arrived or altered files from the host (e.g. MEP's Directory Modification activation feature). It may be possible for a host app, e.g. ME, to type a hotkey which ME running in the VM can react to - I haven't tried this, so don't know the answer; but I do know that a host machine communicating with a remote machine via Microsoft's RDP can do this; I can have a macro on the host activate on receiving, say, Ctrl-Q, and type, say, Shift-Ctrl-Q which will then activate a macro on the remote machine.
  8. I think that's wrong, for one obvious reason. How would you activate the copy running in your VM? It's quite clear that the activation you did for your host system isn't going to work for your VM as all the variables have changed. of course, if you're lucky enough to have a CD that doesn't require activation, that's a different matter.
  9. No problems in running Windows Update. Either you act as a network administrator and download the updates centrally in order to distribute, or you run Windows Update for each environment independently.
  10. No problems in running Windows Update. Either you act as a network administrator and download the updates centrally in order to distribute, or you run Windows Update for each environment independently.
  11. They love it! Interesting topic - and one that MS themselves are not at all clear about, since they contradict themselves widely (e.g. compare the licencing words on your machine with those on MS' sites). Windows 7 (Professional and upwards) actually comes with a free XP Professional VM which you can use with several 3rd-party VM software, so who knows? I think you might be surprised at how well VMs run. A configured VM is also a great way to have a group of people on different machines and in different locations develop and run common applications in identical environments on disparate hardware, e.g. Sql Server Express plus MEP plus various 3rd party software.
  12. You set 2 variables (X and Y) to your start position, use those variables in your Get Pixel command, and increment the X or Y variable after each Get Pixel command, as in: Repeat Until %iPixel% Equals "%iFrameEdge%" -- iFrameEdge is predefined elsewhere Variable Modify Integer %i%: Decrement Get Pixel Color at (%i%, %iControlY%) Relative to Screen into %iPixel% End Repeat
  13. There's no need to move the mouse - the Get Pixel command also works with specific coordinates relative to the screen or to the current window. And actually, in some cases, moving the mouse can fail where Get Pixel works because the mouse can cause colours to change! ........... Some moments later: I see that, in your case, you do need to move the mouse because you do want the underlying colour to change. In such cases, I think it's good practice to return the mouse to its original location where you're done. And, yes, checking for a max value is a really good idea, as I've learnt from bitter experience (just as you did!). Once you've exited the repeat, you should again check whether the mouse position is within limits, otherwise you're clicking on some point you might not want to click on.
  14. I'm interested in finding out what language this thread is being written in; it's not one I'm remotely familiar with! While the words appear to be English, I've never seens "Vikings", "goose" and "egg" next to one other before!
  15. Yes, but with these caveats! - You can't directly drive macros running on the VM from the host - all it sees is the VM software, not anything running inside the VM (although, using MEP, it should be possible to activate macros in the VM by monitoring a folder, and have the host "direct" MEP in VM by passing files in to that folder - but the folder must be a shared folder on the host) - check with Insight on licence issues (does owning a copy of MEP permit additional use in a VM on the same machine?)
  16. It does work with W7. I use it for exactly this purpose.
  17. This is precisely what the registry is ideal for. If you create yourself a key in the registry under HKEY_CURRENT_USER, e.g. MyKey, then you're as likely to damage your registry as you are to reformat your disk by accident - i.e. hardly likely at all.
  18. Each KeyPressx macro (where x is 0-9 and A-Z) has this code: Read Registry Value "HKEY_LOCAL_MACHINE\SOFTWARE\Insight Software Solutions\Macro Express 4\PhtData\KeyPressRepeats" into %N[1]% Repeat Until %T[1]% Does not Equal "*" -- The main keyPress macro resets this registry value when it's finished loading all 36 macros Read Registry Value "HKEY_LOCAL_MACHINE\SOFTWARE\Insight Software Solutions\Macro Express 4\PhtData\KeyPressReturned" into %T[1]% Delay: 20 milliseconds, without ability to halt End Repeat Repeat Start (Repeat %N[1]% times) Wait for Key Press: B -- wait at most 1 second On Error Catch Error: The condition was not met within the specified amount of time Read Registry Value "HKEY_LOCAL_MACHINE\SOFTWARE\Insight Software Solutions\Macro Express 4\PhtData\KeyPressReturned" into %T[1]% If Variable %T[1]% Does not Equal "" Macro Return End If Continue End Catch Error End Error Variable Set String %T[1]% to "B" Write Registry Value "%T[1]%" into HKEY_LOCAL_MACHINE\SOFTWARE\Insight Software Solutions\Macro Express 4\PhtData\KeyPressReturned Break End Repeat As you can see, there are 2 loops in each of 36 macros. The main KeyPress macro also loops KeyPressRepeats times, waiting for a value to appear in the KeyPressReturned registry value, or a timeout, whichever occurs first. With all 36 macros loaded, my CPU load goes to 54% for a few seconds (dualcore CPU 2400Mhz), but the machine seems responsive.
  19. What, you want me to get a second tee-shirt when I never wear the first? Thanks for your comment.
  20. Well, I make one major use of simultaneous macros, and it works very well indeed. While ME has a Wait for Keypress command, it's of limited use. I wanted (and others have expressed a similar wish) to be able to wait for any keystroke, and know what keystroke was pressed. Accordingly I wrote a macro called KeyPress. It is passed a string of between 1 and 36 characters (0-9, A-Z) representing the keystrokes I am currently interested in, initializes the registry with several values and then calls as many macros (all identical except for the character they are comparing against) as there are characters passed in, e.g. KeyPressA, KeyPressM, KeyPressT, each of which is launched asynchronously (i.e. without waiting for it to terminate). One more macro is launched, also asynchronously, which displays a dynamically-created menu corresponding to the key presses of interest (e.g. Axxxxx, Mxxxxxx, Txxxxx). The KeyPress macro then goes into a loop waiting for the relevant registry value to be set (by KeypressA, M or T) to one of these values, or one indicating the user-specified timeout (usually around 3 seconds) has occurred. The menu macro is then closed. I have tested this with all 36 characters at the same time (i.e. 38 macros running simultaneously), and it worked flawlessly.
  21. Go stand in front of a bookcase containing some books. Look along, say, the 3rd shelf. Let's assume it contains 10 books. The 6th book in this shelf contains 200 pages. The 40th page in this book contains 750 words. Each object is a single-dimension array, i.e. Shelves, Books, Pages. Many computer languages (but not MEP) allow you to store a single multi-dimensional array, so that a reference to MyArray(3 (shelf), 6 (book), 40 (page)) would return 750 (number of words). Arrays are easy to navigate: for i = 1 to 10 ... shelf processing for j = 1 to 100 ... book processing for k = 1 to 1000 ... page processing next k next j next i which assumes up to 10 shelves in my single bookcase, up to 100 books per shelf, and up to 1000 pages per book. Does that help, or have I simply made things worse?
  22. Some binary and multi-string values get pretty long (or are you referring to the length of a key name?).
  23. I think I'm confused by your terminology, and am having difficulty in deciding whether you're talking about opening one or more macro files in Macro Explorer, or running macros. You say "open the next macro" - does that mean opening a new macro file? You say "multiple copies of those macros try to run" - what does that mean? You say "normally I only run one macro file at a time" - again, I'm confused by the use of "run". I think you're talking about Macro Explorer, and having one or more macro files open - nothing to do with running macros. Am I right? If so, then I guess you're talking about having include functionality, like AutoIt's #include syntax. Right?
  24. Long ago and in another thread (A Call To Curtail A Few Annoyances) were these 2 conversation snippets: I wrote and Cory responded And, finally, in this thread, Cory wrote !!! :rolleyes:
×
×
  • Create New...