NeVeR Posted August 30, 2013 Report Share Posted August 30, 2013 Hi All. I'm making a macro for my website. I need the marco to find a button and click it. The normal way I would do this is find text.. press esc then press Enter.. but the press enter doesn't work on these buttons for some reason. Is there a way to trigger a mouse click on a set bit of text ? I can't do a mouse position then click as I'd need this to work on different screen sizes. I actually need this to happen twice. Once on the same button text which is "Join game" and then again on something different every time ( I will have this macro on repeat and each time it will be picking something different from a set T3 tag ) so tips would be great. Thanks. Quote Link to comment Share on other sites More sharing options...
Samrae Posted August 30, 2013 Report Share Posted August 30, 2013 Does Enter work on the buttons when they are active? Have you tried find text, tab to the button and then Enter? Quote Link to comment Share on other sites More sharing options...
NeVeR Posted August 30, 2013 Author Report Share Posted August 30, 2013 Enter doesn't work. I've tried it. What i normally do in cases like this is ctrl down f ctrl up TEXT TO SEARCH - ESC and then ENTER to press it.. but doesn't work on this button.. even though i can highlight the text. Quote Link to comment Share on other sites More sharing options...
Samrae Posted August 30, 2013 Report Share Posted August 30, 2013 What I do is to search for some text in front of the button, type TAB to get focus to the button and then do the ENTER. Are you searching for the text of the button or text of something in front of the button? Quote Link to comment Share on other sites More sharing options...
acantor Posted August 30, 2013 Report Share Posted August 30, 2013 Try spacebar instead of Enter. Buttons generated via JavaScript may not be keyboard accessible. Ditto for HTML buttons that are improperly coded. Have you validated the code? A valid HTML button that has keyboard focus is activated by pressing Enter. If this doesn't work, fix the code on your website. Quote Link to comment Share on other sites More sharing options...
NeVeR Posted September 5, 2013 Author Report Share Posted September 5, 2013 Hi, Sorry for the late reply. The code is valid. The buttons are made using CSS. I tried the spacebar and it doesn't work either. Here's something I tested. When i search for the word.. and press ESC on it.. Enter doesn't work ( or spacebar ) .. but if i press TAB.. and then enter/spacebar it does work. But by press tab i'm moving to the next button .. which is not what I want to do.... I should note that all the buttons are using the same CSS. is it possible in Macro express to move the mouse to a bit of text ? That way I could move it to the text and issue a mouse click command. Quote Link to comment Share on other sites More sharing options...
NeVeR Posted September 5, 2013 Author Report Share Posted September 5, 2013 What I do is to search for some text in front of the button, type TAB to get focus to the button and then do the ENTER. Are you searching for the text of the button or text of something in front of the button? I'm searching the text on the button. i can't search for something before it as it changes all the time. I need to click the text on the button. Quote Link to comment Share on other sites More sharing options...
acantor Posted September 5, 2013 Report Share Posted September 5, 2013 When i search for the word.. and press ESC on it.. Enter doesn't work ( or spacebar ) .. but if i press TAB.. and then enter/spacebar it does work. But by press tab i'm moving to the next button .. which is not what I want to do.... I should note that all the buttons are using the same CSS. If you are able to reach the target by searching for a word, pressing Esc, pressing Tab (which moves focus to the next element), then Shift + Tab (which moves focus back to the target), and then Enter.... you have found a solution. It's not elegant, but it's a solution nonetheless. Quote Link to comment Share on other sites More sharing options...
NeVeR Posted September 6, 2013 Author Report Share Posted September 6, 2013 thanks.. I'll test that. .I didn't know about Shift+tab. but I hope it works. Thanks . I'll report back. Quote Link to comment Share on other sites More sharing options...
acantor Posted September 6, 2013 Report Share Posted September 6, 2013 Sometimes it is most reliable to find text nearby the target, and then either Tab or Shift+Tab to the target. In this example, the target is three tabs before the "Country" field. You might want to do this if the text associated with the target itself is not searchable (e.g., an image) or is ambiguous (e.g., there is more than one field with exactly the same label.) // Navigate to a button that is three controls "before" the Country field // Text Type: <CONTROL>f // Initiate search Delay: 100 ms // Text Type: Country // We will search for the "Country" field... Delay: 100 ms // Text Type: <ENTER> // Do the search Delay: 100 ms // Text Type: <ESC> // Cancel search, which gives focus to the found text Delay: 100 ms // Text Type: <SHIFT><TAB><SHIFT><TAB><SHIFT><TAB> // Back-tab three times... Delay: 100 ms // Text Type: <ENTER> // We arrive at the button. Activate it. Quote Link to comment Share on other sites More sharing options...
NeVeR Posted September 27, 2013 Author Report Share Posted September 27, 2013 thanks lads.. the shift+tab worked perfectly 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.