![]() |
![]() |
We are currently migrating this forum over to our HelpSystems domain. Please post all new threads in our new HelpSystems Community Portal. |
![]() |
|
![]() |
AutoMate Discussion | ![]() |
help :
faq :
home
|
||
Latest News:
|
latest topics : statistics |
Topic Title: Search for text in terminal window Topic Summary: Created On: 12/18/2016 02:24 PM Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
||||||||||
Hi Guys
I get Automate to open a terminal window every hour I have another program running that displays text in about 6 lines it refreshes every 40 seconds. I use Automate to copy a line of text to notepad. The problem is every time the terminal window opens the text that is displayed is not in the same order. The line Im looking for is "The temp is ?" Is there a way to search for this line and copy it. Thanks Rick
|
||||||||||
|
||||||||||
![]() |
||||||||||
Rick,
Could you post your task. The solution depends on how your read the text, but I'm sure this is possible.
------------------------- ![]() |
||||||||||
|
||||||||||
![]() |
||||||||||
Here you go
Have a look Thanks
Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)
|
||||||||||
|
||||||||||
![]() |
||||||||||
If you after line 8 would safe the file and add the attached code, it should work. (of course adjust the file name)
Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder) ------------------------- ![]() |
||||||||||
|
||||||||||
![]() |
||||||||||
Thanks for the info. I've inserted your code after my line 8. Im not sure how to add a line after my line 8 and the start of yours to save the file. Actually Im not sure what file Im suppose to save.
Any suggestions Rick
|
||||||||||
|
||||||||||
![]() |
||||||||||
Rick,
If I understand your code correctly, you open notepad (line 6) and paste your read date into notepad (line 7). If you save that file, my code will read the file and select teh right line for you.
------------------------- ![]() |
||||||||||
|
||||||||||
![]() |
||||||||||
Thanks. Ill give it a try tonight. Just wondering is there a reason that I have to save the Notepad file first. Can I not search for the text before I close notepad
Rick
|
||||||||||
|
||||||||||
![]() |
||||||||||
I let you save the file as it is easy to search the file for the correct line. It probably can also be done by searching the value of the variable directly, but than I need to know mere about the exact content and characters used,
------------------------- ![]() |
||||||||||
|
||||||||||
![]() |
||||||||||
Sorry Im confused when I copy your code into mine after line 8 its missing information as you can see in the attached screen shot "Code". I dont see VALUE="The temp is 65" /> and VALUE="The temp is" /> When I copy the code to this reply I can see the missing info.
Whats going on. I have also attached a screen shot of the terminal window "Terminal Window" so you can see the exact line that I need copied. The only thing that would change is the number. Any chance there is a way to search for this line when copied to notepad without saving. Thanks for your help Merry Christmas Rick
Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder) |
||||||||||
|
||||||||||
![]() |
||||||||||
Hi Rick,
The steps that Gijsberth posted were created in version 10 and in the case of the IF text contains action, are not compatible with version 9. Attached is a IF text contains step that is compatible with version 9.
Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder) ------------------------- ![]() Justin Aucoin | Support Analyst AutoMate | Division of HelpSystems HelpSystems, LLC | T: +1.213.738.1700 | F: +1.213.738.7665 |
||||||||||
|
||||||||||
![]() |
||||||||||
Thanks guys for your help. Ive being trying to do what you suggest over the holidays. My skills at programming are limited.
First thing I changed Line 4 from coping a specific line because it was wrong most of the time anyway to capture the hole screen. Problem is when sending the text to notepad it takes a couple of minutes to complete. While this is not a big problem is there not away around that. In line 3 I can pause the task until it reads "Temperature is X degrees" so it can read the text. Is there no way to copy just the text I want. If not then Second I cant figure out how to save the notepad file Rick Disregard line 7
Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder) Edited: 12/28/2016 at 09:02 AM by RickJohnson |
||||||||||
|
||||||||||
![]() |
||||||||||
Hi Rick,
The attached code should file your requirements. I removed the run notepad.exe action in favor of a write to file option that will save it directly. I also added a loop list of the variable "yui", based on line, that will look for a line containing "The temperature is" and then read the line after a dialog box.
Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder) ------------------------- ![]() Justin Aucoin | Support Analyst AutoMate | Division of HelpSystems HelpSystems, LLC | T: +1.213.738.1700 | F: +1.213.738.7665 |
||||||||||
|
||||||||||
![]() |
||||||||||
Justin thank you very much for your script. Works better then what I had there is only one problem it reads everything instead of just the line with the Temperature. The attached is a screen shot of what it reads. Each time could be a little different depending whent the terminal window is open and where the Arduino is with the sketch its running.
Any ideas Rick
|
||||||||||
|
||||||||||
![]() |
||||||||||
Does the variable vtextloopup match the start of the line you look for? if not, you should correct the value of the variable.
------------------------- ![]() |
||||||||||
|
||||||||||
![]() |
||||||||||
Thanks very much for your help its working great. I didn't notice The infront of Temperature is in the vtextlookup. I dissabled the message box line 11 and I dissabled the line 16 and 17. The script would read the temp then go on and line 17 would read out everything.
Hope everyone has a good New Year. Thanks again Rick
|
||||||||||
|
||||||||||
![]() |
||||||||||
Great,
Happy New Year!
------------------------- ![]() |
||||||||||
|
AutoMate Discussion
» AUTOMATE » AutoMate 9
»
Search for text in terminal window
|
![]() |
FuseTalk Enterprise Edition v4.0 - © 1999-2021 FuseTalk Inc. All rights reserved.