jso Posted October 25, 2019 Report Share Posted October 25, 2019 I am trying to do the steps with the Macro tool that will depend on the messages that I am getting from the windows app. Quote Link to comment Share on other sites More sharing options...
terrypin Posted October 25, 2019 Report Share Posted October 25, 2019 Well, if you do have a question we’re going to need more information than that if you want help. Do you mean that you want to capture a particular type of message that does not allow copying to the clipboard? If so, describe an example in detail or tell us exactly how we can reproduce it. Show us some screenshots. Also, what script have you tried so far and what is the result? You can show your script commands and the resulting code using the Code tool, <>. Terry Quote Link to comment Share on other sites More sharing options...
jso Posted October 25, 2019 Author Report Share Posted October 25, 2019 I created macro that closing the claims. 10 % of all claims can't be closed because some additional steps have to be completed prior to closing. Pop up box let me know what has to be done for these 10% of all claims. How i can capture this situation? Planning to use MEP logic for the resolution. But I need to know how to capture the popup box and the message. Quote Link to comment Share on other sites More sharing options...
acantor Posted October 25, 2019 Report Share Posted October 25, 2019 During the early 2000s, Microsoft introduced a way to copy information from a message box to the clipboard. For this method to work, the message box must have focus. But nothing needs to be selected. In many (although not all) message boxes, pressing Ctrl + C copies its content to the clipboard as plain text. So the script might look like this. Text Type (Simulate Keystrokes): <CONTROL>c Variable Set String %x% from the clipboard contents If Variable %x% Contains "Hello" MessageBox: Result True Else MessageBox: Result False End If <TEXT TYPE Action="0" Text="<CONTROL>c"/> <VARIABLE SET STRING Option="\x02" Destination="%x%" NoEmbeddedVars="FALSE"/> <IF VARIABLE Variable="%x%" Condition="\x06" Value="Hello" IgnoreCase="FALSE"/> <MESSAGEBOX Caption="Result True" Message="Contains \"Hello\"" Icon="0"/> <ELSE/> <MESSAGEBOX Caption="Result False" Message="Does not contain \"Hello\"" Icon="0"/> <END IF/> Quote Link to comment Share on other sites More sharing options...
terrypin Posted October 26, 2019 Report Share Posted October 26, 2019 14 hours ago, jso said: I created macro that closing the claims. 10 % of all claims can't be closed because some additional steps have to be completed prior to closing. Pop up box let me know what has to be done for these 10% of all claims. How i can capture this situation? Planning to use MEP logic for the resolution. But I need to know how to capture the popup box and the message. No screenshot or link as requested so I'll assume that you want to capture the text in pop-up boxes that do not allow the usual 'select then copy' approach. If the text needs to be pasted elsewhere but does not necessarily have to be 100% accurate, investigate OCR using a third party tool. If the text is brief and for your personal guidance after closing the message, consider capturing its image and displaying it conveniently, or saving it in a reference folder. Quote Link to comment Share on other sites More sharing options...
Cory Posted November 4, 2019 Report Share Posted November 4, 2019 I use controls commands in MEP. The Wait For Control is also valuable. Then one an get the text form the message box using that same control if necessary. Quote Link to comment Share on other sites More sharing options...
jso Posted January 21, 2020 Author Report Share Posted January 21, 2020 On 10/25/2019 at 1:16 PM, acantor said: During the early 2000s, Microsoft introduced a way to copy information from a message box to the clipboard. For this method to work, the message box must have focus. But nothing needs to be selected. In many (although not all) message boxes, pressing Ctrl + C copies its content to the clipboard as plain text. So the script might look like this. Text Type (Simulate Keystrokes): <CONTROL>c Variable Set String %x% from the clipboard contents If Variable %x% Contains "Hello" MessageBox: Result True Else MessageBox: Result False End If <TEXT TYPE Action="0" Text="<CONTROL>c"/> <VARIABLE SET STRING Option="\x02" Destination="%x%" NoEmbeddedVars="FALSE"/> <IF VARIABLE Variable="%x%" Condition="\x06" Value="Hello" IgnoreCase="FALSE"/> <MESSAGEBOX Caption="Result True" Message="Contains \"Hello\"" Icon="0"/> <ELSE/> <MESSAGEBOX Caption="Result False" Message="Does not contain \"Hello\"" Icon="0"/> <END IF/> My message takes several lines. How I can add 'RETURN' to %x%.Value? Can I use LIKE to specify only part of the message? Quote Link to comment Share on other sites More sharing options...
Samrae Posted January 22, 2020 Report Share Posted January 22, 2020 For Windows the value for 'RETURN' is actually a CR followed by LF. You can define variables to represent CR and LF: Variable Set to ASCII Char 13 to %CR% Variable Set to ASCII Char 10 to %LF% Then you could use something like this: If Variable %x% Contains "Hello%CR%%LF%There" to search for Hello there There are a couple of ways to search for parts of the message. If Variable %x% Contains "Hello" AND If Variable %x% Contains "there" MessageBox: Result True Else MessageBox: Result False End If Another way would be to parse the message using the Variable Modify String command options. (This is more involved so I do not provide an example here.) Quote Link to comment Share on other sites More sharing options...
acantor Posted January 22, 2020 Report Share Posted January 22, 2020 2 hours ago, jso said: Can I use LIKE to specify only part of the message? No, but Macro Express IF statements can test a variable to find out whether it CONTAINS something: If Variable %x% Contains "Hello!" If Variable %x% Contains "Goodbye?" If Variable %x% Contains "!" If Variable %x% Contains "?" If Variable %x% Contains "H" If Variable %x% Contains "G" If Variable %x% Contains " " So, if %x% = "Hello! Goodbye?" then all of the above statements will return TRUE. Quote Link to comment Share on other sites More sharing options...
jso Posted January 22, 2020 Author Report Share Posted January 22, 2020 Is' there a work around for the messages that can not be copied to the clipboard? Quote Link to comment Share on other sites More sharing options...
acantor Posted January 23, 2020 Report Share Posted January 23, 2020 There may be a workaround. The most elegant, if you can get it to work, is to capture the window control of the message. Maybe something like this will get you started. But you will probably need to do a lot of trial-and-error experimentation to get it to work, if it works! Get Control: (ProgramName.EXE) Using z-order -> %x% Get Control Class from %x% into %xClass% Get Control Text from %x% into %xText% Text Box Display: Class = %xClass% Text Box Display: Text = %xText% If the information you want is in xClass or xText, you may need instructions to parse it. Quote Link to comment Share on other sites More sharing options...
Cory Posted January 25, 2020 Report Share Posted January 25, 2020 Why can't you get the message using the Windows Control commands in MEP? 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.