John Haluska Posted January 23, 2023 Report Share Posted January 23, 2023 I have captured the Current Screen in the clipboard. I need to search for a specific text and then click on it. The problem is that I have encountered a window where depending on messages in the screen, the specified text can move down. It is not in a static location. My current process does a clipboard copy to a %var% and then I If variable %var% contains the text and then I process it by statically moving the cursor. But now that it moves around, I have a problem. Would like the ability to search for the text in the Current Window and have it return the location so that I can left click, or left double click. (It would be nice if there was a parameter that called for occurrence, i.e." 2" for the second occurrence of the text, defaulting to 1) Is there a current way to do this? Or could this feature be added to a new release. Thank You. Quote Link to comment Share on other sites More sharing options...
Cory Posted January 23, 2023 Report Share Posted January 23, 2023 It depends. Is this a web browser, traditional WinForm app, or a UWP app? Quote Link to comment Share on other sites More sharing options...
acantor Posted January 24, 2023 Report Share Posted January 24, 2023 I've built scripts that search for text adjacent to a field I want to focus. Then the script tabs or (Shift+Tab) to the target. In pseudo code.... Type "Control+F" // Find on the page. In some applications, you can use F3. Wait a split second Type "City:" // Unique text near the field I want to get to Type "{Enter}" // Initiate the search Type "{Esc}" // Cancel the search Wait a split second Type "{Tab}{Tab}" // Navigate to the field i want to reach This approach is fussy. It takes trial and error to get the timing right, and to work out what text to search for. But with effort, I can usually get it to work almost 100% of the time. Quote Link to comment Share on other sites More sharing options...
rberq Posted January 24, 2023 Report Share Posted January 24, 2023 Like acantor said. Also, sometimes you can search for text within a button that can be either clicked or activated with the ENTER key. For example, the snippet below logs me out of several web sites: Text Type (Simulate Keystrokes): <HOME> Text Type (Simulate Keystrokes): <CTRLD>f<CTRLU>log out<ESC> Delay: 250 milliseconds Text Type (Simulate Keystrokes): <ENTER> It would be handy if there were a browser operation to find text AND automatically position the mouse over that text. Quote Link to comment Share on other sites More sharing options...
acantor Posted January 24, 2023 Report Share Posted January 24, 2023 Firefox has a search-links-only feature which I've used instead of Ctrl + F to reduce search volume. The feature is helpful in another situation: If a string appears many times on a page, but only once as part of a hypertext link, search-links ensures the script zeros in on the link. The hotkey for search-links in Firefox is the open single quote character. That's a problem. If focus is in an editable field, the hotkey fails; instead the hotkey inserts the single quote character. (Maybe there's a way to change the hotkey to Ctrl + something, which would allow feature to work in more contexts.) Strangely, the feature appears to be absent in Chrome and Edge. Quote Link to comment Share on other sites More sharing options...
Frank Posted May 12, 2023 Report Share Posted May 12, 2023 Thanks to you guys for the information and advice... I have spent the last 24 hours learning the windows and tab. I was able to get rid of a lot of the mouse move commands... F 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.