Huntknife Posted February 28, 2020 Share Posted February 28, 2020 ; Activate test.txt WinActivate ("test.txt") ; Delay 2 seconds Sleep (2000) ; Inserting text to notepad Opt('SendKeyDelay', 70) ControlSend ("test.txt", "", "Edit1", "HELLO WORLD") ; Delay 2 seconds Sleep (200) ; Choosing menu items WinMenuSelectItem("[CLASS:Notepad]", "", "&File", "Save &As...") ; Delay 2 seconds Sleep(2000) ; Change file name ControlSend ("Save As", "", "Edit1", "HELLO WORLD.txt") ; Delay 2 seconds Sleep (2000) ; Save file button ControlClick ( "Save As", "", "&Save") ; Delay 2 seconds sleep (2000) ; Closing Notepad WinClose("[CLASS:Notepad]", "") I am testing Autoit becouse i want to us it at my work to do some repetitive tasks, could someone help me with variables? Here i have little code which opens text file, inserts some text then going to menu settings changing the name of the file then saves it and closes it. I would like to have variable at "HELLO WORLD" for example (My variable) = "HELLO WORLD" so i could insert my variable and all code changes to it. But i can't find example of it 😕 Link to comment Share on other sites More sharing options...
Subz Posted February 28, 2020 Share Posted February 28, 2020 Just use something like: Local $sMessage = "Hello World" MsgBox(4096, "Title", $sMessage) Link to comment Share on other sites More sharing options...
Huntknife Posted February 28, 2020 Author Share Posted February 28, 2020 (edited) 3 minutes ago, Subz said: Just use something like: Local $sMessage = "Hello World" MsgBox(4096, "Title", $sMessage) That helped me a lot and saved me a lot of time from searching. Thank you bro really apreciate it Edited February 28, 2020 by Huntknife Link to comment Share on other sites More sharing options...
MurtCurious Posted March 2, 2020 Share Posted March 2, 2020 AutoIt documentation link for variables help https://www.autoitscript.com/autoit3/docs/intro/lang_variables.htm . For other topics https://www.autoitscript.com/autoit3/docs/ Link to comment Share on other sites More sharing options...
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