Amerifax-Bob Posted April 25, 2011 Report Share Posted April 25, 2011 I need help doing the following. I know it will need an if statement, I'm just not sure how to do it exactly. When searching for a value, using the find command, 1 of 2 things can happen: 1. If value is not found program will open a window with the name UltraEdit. 2. If the value is found, I want to highlight the word(s) by doing a Shift End and copying it to a variable. When running the macro without stopping, how do we know which value has been found? Thanks for any help. Bob Quote Link to comment Share on other sites More sharing options...
acantor Posted April 25, 2011 Report Share Posted April 25, 2011 // Method 1 - Use a variable to capture the window title Variable Set String %WindowTitle% to topmost window title // Test if the focused window title contains the words "UltraEdit" If Variable %WindowTitle% Contains "UltraEdit" // Value not found. Do something. Else // Value is found. Select to end of line. Text Type (Simulate Keystrokes): <SHIFT><END> End If // Method 2 - Use the "If Window" command If Window "UltraEdit" is focused // Value not found. Do something. Else // Value is found. Select to end of line. Text Type (Simulate Keystrokes): <SHIFT><END> End If Quote Link to comment Share on other sites More sharing options...
Amerifax-Bob Posted April 25, 2011 Author Report Share Posted April 25, 2011 Thanks so much for the quick response. I will give that a try. Bob Quote Link to comment Share on other sites More sharing options...
Cory Posted April 25, 2011 Report Share Posted April 25, 2011 I’m not sure but it sounds like you're opening a text file in anapplication and using the find command to see if something exists. A betterapproach would be to load the file contents into a text variable and using theMEP command “If” with the option “Contains”. 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.