Frank Posted May 10, 2023 Report Share Posted May 10, 2023 Hello All... Q1= Mouse Location Variable Q2=Sound file variable Q1 Created a macro that will be put on 3 different computers... In the macro the mouse has to move to a specific location and click three different times in the macro. Because the exact location changes depending on the computer and monitor, I would like to set the locations as a variable at the top / beginning of the macro code. I know I can set X and Y variables BUT is there an easier way to do this? I would like to MOVE MOUSE, Click CTRL + SPACE, and then store as variable but i don't see that option... Any suggestions or comments on how to accomplish this. Q2 Similiar to the above question, same macro plays a few sound files throughout the macro. Is there a way to SET A VARIABLE as a sound file so that I can list the sound file once, at the beginning and refer to the varaible later in the macro ... to play Thanks in advance! F Quote Link to comment Share on other sites More sharing options...
acantor Posted May 10, 2023 Report Share Posted May 10, 2023 3 hours ago, Frank said: I know I can set X and Y variables BUT is there an easier way to do this? I would like to MOVE MOUSE, Click CTRL + SPACE, and then store as variable but i don't see that option... I don't think there's an easier way. When you are manually setting up the macro, you should be able to use Ctrl + space to automate the process of setting the coordinates. Quote Similiar to the above question, same macro plays a few sound files throughout the macro. Is there a way to SET A VARIABLE as a sound file so that I can list the sound file once, at the beginning and refer to the varaible later in the macro ... to play Variable Set String %SoundFile1% to "c:\tmp\Sounds\Beep.wav" Sound File: %SoundFile1% Quote Link to comment Share on other sites More sharing options...
Cory Posted May 10, 2023 Report Share Posted May 10, 2023 Q1 is a reason I rarely use the mouse and instead use the Windows Controls commands. Will that work for you in this application? I don't understand #2. Of course you can set a variable to the path of a file and use it again later. But that's too simple so I'm not understanding what you mean. Quote Link to comment Share on other sites More sharing options...
Cory Posted May 10, 2023 Report Share Posted May 10, 2023 Weird. I submitted that message before and it didn't go. Also for Q1 I'd use Mouse Click on Control. This way you don't need to worry about coordinates. Quote Link to comment Share on other sites More sharing options...
Frank Posted May 10, 2023 Author Report Share Posted May 10, 2023 Thank you for all of the feedback. aacantor - The string variable worked ... cory - I have zero experience with CONTROL. I have read the help section and tried to use it but no luck I believe for control, I have to put in commands of... 1. Get control and save as a varaible then 2. Mouse click control variable but that has not worked. I will keep trying... F Quote Link to comment Share on other sites More sharing options...
Cory Posted May 10, 2023 Report Share Posted May 10, 2023 You will read me here often stating this. Learning those control command as soon as possible will give you greater capability and save you much time in the future. I resisted for a long time then I slapped myself in the forehead when I realized how simple and powerful they were And realized I had wasted thousands of hours by not learning them sooner. But it's not for all application. For instance a web page or UWP app. But you made no indication what type of app you were automating. Quote Link to comment Share on other sites More sharing options...
Frank Posted May 11, 2023 Author Report Share Posted May 11, 2023 Cory, again thanks for the info / advice. I am using the macro for web pages in chrome. I really have looked at CONTROL and just have not had any luck implementing the commands. Maybe you can answer this. assume I kinda know what i am doing elsewhere in ME... If I am on a web page and I want to click a button I believe that I have to add these commands GET CONTROL - launch the tool and hover it over the button...store it as a variable. This is in the beginning of the code when I am defining variables during the execution of the macro when the time comes to click the button I would add SET FOCUS - to the variable of the control MOUSE CLICK Would that be correct? F Quote Link to comment Share on other sites More sharing options...
Cory Posted May 11, 2023 Report Share Posted May 11, 2023 Control commands don't work in UWP or web pages. MEP isn't the best program for automating web pages. You migh tconsider iMacros. Having said that, if it's not super repetitive, you can have some success. But I, and many of the guys here, avoid the mouse like the plague. As much as you think mouse is difficult now in a web page, it gets worse. Wait until your users start zooming in and out. 🙂 The best bet is to try and do everything with keyboard commands. What I do is with the browser focussed, hit the home button, to be sure, then tab through the web form controls counting and making a note of the index of each. Then I write, don't use the recorder, the keyboard text type commands to get to the controls I want. Check out enter, tab, arrows. Most web pages are designed to be navigable with a keyboard. Enter will make a button click event. Quote Link to comment Share on other sites More sharing options...
acantor Posted May 11, 2023 Report Share Posted May 11, 2023 This thread includes a description of another way to navigate to a location on a web page. Like Cory's method, knowing how to get around a web page via the keyboard is extremely helpful. 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.