jsampsonyyyyy Posted September 15, 2014 Report Share Posted September 15, 2014 I have a process in Microsoft Word which has to be repeated many times. It involves eleven mouse clicks in different places. I turned on the Mouse Locator and did the process manually, recording the positions of the mouse clicks. When I run the macro, the mouse clicks occur in different places from the ones I filled in to the 'move mouse' selection boxes, making a complete mess of things. Is there a way of running the macro very slowly, with the mouse position shown (X and Y values) at each click, so that I can see what is going wrong? If there were, I could take notes on paper rather than trying to use the same mouse as the one that is being manipulated automatically. Quote Link to comment Share on other sites More sharing options...
Cory Posted September 15, 2014 Report Share Posted September 15, 2014 You could put delays after each mouse move. Also make sure to check if the mouse movements are with relation are properly set to the window or screen. Quote Link to comment Share on other sites More sharing options...
acantor Posted September 16, 2014 Report Share Posted September 16, 2014 What are you trying to do with all those clicks? The reason I ask is that there are very few tasks in Microsoft Word that require pointing and clicking. I would guess that 99+% can be accomplished purely by sending a few keystrokes. Macros are far more reliable when keystrokes substitute for mouse clicks. Quote Link to comment Share on other sites More sharing options...
rberq Posted September 16, 2014 Report Share Posted September 16, 2014 Ditto what Alan said. Withing limits, keystrokes have the advantage that Windows MAY buffer them so you can feed them to Word faster than it can process them, which simplifies timing (see below). For testing/debugging, after each mouse move use a ME text box to display where you have moved it to, instead of having ME click the mouse. Then you can move and click the correct spot manually, so as to continue through the process and take more notes. You may have to insert delays so Word can respond to a mouse click, before you continue to the next click. Often time delays will not be reliable because Windows will respond faster or slower depending what else it is doing. In cases where the screen changes you may be able to check pixel color at selected places to wait for the screen to change, so you will not be clicking the wrong screen. Quote Link to comment Share on other sites More sharing options...
jsampsonyyyyy Posted September 16, 2014 Author Report Share Posted September 16, 2014 I have a delay after each click already - can they be changed en masse or do I have to change each one individually? What is an ME text box? I would have to do the mouse clicks as they open new windows or controls. As far as I know there are no keyboard alternatives to the mouse clicks - if there were I would use them. It may be that I should try this in Autohotkey, or save time by doing the job manually. Quote Link to comment Share on other sites More sharing options...
Cory Posted September 16, 2014 Report Share Posted September 16, 2014 I would use the controls feature in MEP. You can send click events to controls like a button, send text to the controls and so forth. There is a calculator tutorial in the samples macro you got with MEP. But if you don't want to take the time to do controls you can still usually manipulate all controls in Windows applications with keystrokes. You can tab to the control and hit enter to depress a button or you can use the controls hotkey. Sometimes Windows hides the indicators. But in Word for instance in the Save As dialog box hit the CTRL button. Note that some of the letters are now underlines. So if I want to move to the "Save as Type" control I click CTRL+t since the "t" is underlined in the label. It's kind of a rule in Windows that you have to provide a way to do almost everything by keyboard. Regarding text boxes look in your list of commands in the Script Editor and you will find one called Text Box Display. Quote Link to comment Share on other sites More sharing options...
Samrae Posted September 16, 2014 Report Share Posted September 16, 2014 To allow delays to be modified add something like this to the top of your macro: Variable Set Decimal %SmDelay% to 0.1 Variable Set Decimal %MedDelay% to 0.5 Variable Set Decimal %LgDelay% to 1.0 Then, where needed in your macro, add delay commands like this: Delay: %MedDelay% seconds Quote Link to comment Share on other sites More sharing options...
terrypin Posted September 17, 2014 Report Share Posted September 17, 2014 With only 11 clicks I expect you've sorted it by now, but you can use the Macro Playback Speed command to change all delays globally. Also experiment with Mouse Speed. Occasionally I set it as high as 5 ms. --Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.