Wozn Posted January 10, 2019 Posted January 10, 2019 Hello, I'm new to AutoIt and right now I'm writing my second code. The code already selects a texts and now it should read the marked text and check if the text contains the word "yes". If the text contains "yes" the word should be changed into "no". My question: is there a way to get the text into the code and check it? Thank you. Wozn
FrancescoDiMuro Posted January 10, 2019 Posted January 10, 2019 Hi @Wozn, and welcome to the AutoIt forums Could you please post the code and tell us from where are you trying to get the text? Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
Wozn Posted January 10, 2019 Author Posted January 10, 2019 Hi, thank you @FrancescoDiMuro. Here is my code: WinActivate("Blog Wikipedia - Mozilla Firefox") MouseClick("left", 1445, 953, 3) ; select a part of the text Sleep(500) ; copy and check WinActivate("Blog - Word") Send("^v") I am trying to get the text from my browser and paste the checked text to word. (the words "yes" and "no" were just examples to make the question short)
Danp2 Posted January 10, 2019 Posted January 10, 2019 There are more reliable ways to do this than relying on MouseClick / Send. You may want to take a look at the Webdriver UDF (see my signature). There's also a UDF for MS Word. Latest Webdriver UDF Release Webdriver Wiki FAQs
Nine Posted January 10, 2019 Posted January 10, 2019 ; copy and check Send ("^c") $Str = Clipget () ; To do some modifications to the $Str : ; use StringInStr() to search ; use StringReplace () to change ClipPut ($Str) ; there you go as it was already stated, there is more reliable ways to do what you want but this will give an early start. Happy scripting ! “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now