rjbantau Posted August 21, 2013 Report Share Posted August 21, 2013 Hello Macro Allstars ! I have a very specific need. I have a macro running in a telnet client. Occasionally, I would like to evaluate some of the data in the window. Is there a direct way to look in the focus window for specific text and then take <n> chars after that text and put it into a variable ? I've found a way to get all of the text on the screen onto the clipboard with recorded mouse clicks but I'd like to do it cleaner than that if possible. Assuming though that I have to go this route, the top line will have the data I need to look at. It will be something along this line: "You have processed 350 records today" I want to get 350 into a variable. It doesn't even need to be an int. It can be a string. Please help Thank you in advance! Quote Link to comment Share on other sites More sharing options...
MattM2013 Posted August 21, 2013 Report Share Posted August 21, 2013 Text Type: <CONTROL>a---->if it's possible to do a select all in telnetClipboard CopyVariable Set String %T1% from ClipboardVariable Modify String: Copy Part of %T1% to %T2% ---> this would copy the 350. you set the starting position and tell it how many characters to copyText Box Display: Show T2 --->would show 350 hopefully that helps some. Quote Link to comment Share on other sites More sharing options...
rjbantau Posted August 22, 2013 Author Report Share Posted August 22, 2013 I think that will get it done. I'll test tomorrow and report back. Thank you ! Quote Link to comment Share on other sites More sharing options...
rjbantau Posted August 23, 2013 Author Report Share Posted August 23, 2013 This works but I run into problems when I move from my docking station to just my laptop because of the difference in resolution and the changing of positions that I make the macro click. However, I have found that I can log my telnet session to a log file. I can then dump that log file into a variable. I can execute a command, read the log into a string variable (%T1%) and then the data I'm looking for is on the last line. I see that there is a command to see if a variable contains a value. Is there a way to determine the position of that data ? That would certainly solve my issue completely. Quote Link to comment Share on other sites More sharing options...
Samrae Posted August 23, 2013 Report Share Posted August 23, 2013 Try the "Variable Set Integer %N1% from Position of Text in Variable %T1%" command. Quote Link to comment Share on other sites More sharing options...
rjbantau Posted August 23, 2013 Author Report Share Posted August 23, 2013 That's exactly what I needed. Now that I'm learning to search through the available commands, I have it working flawlessly. Thank you for your help. 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.