Rawox Posted September 26, 2008 Posted September 26, 2008 Hi Guys, I first readed the FAQ but could not find any answer to this question so I just post it here I made an little script that opens Notepad, types some text and then clicks close -> yes, save it and then gives an name. I can also make it to work to click on 'Save' so the .txt file is saved. But I want to always save it on the desktop. Does anyone knows how to do that? Here is my code: ; Opening Notepad Again for Scan Result Window Run("notepad.exe") WinWaitActive("Untitled - Notepad") Sleep ( 400 ) Send("-------------------------------------------------------------------------------------------{ENTER}") Sleep ( 800 ) Send("| This Scan Was Done By: Computer Sam. |{ENTER}") Send("| Computer Sam from: Microsoft Office. |{ENTER}") Send("| Time past: 13 seconds. |{ENTER}") Send("| Typ of Scan: Time. |{ENTER}") Send("| Directory of Saved Log: Desktop |{ENTER}") Send("-------------------------------------------------------------------------------------------{ENTER}") ;Save WinClose("Untitled - Notepad") WinWaitActive("Notepad", "Do you want to save") Sleep ( 1 ) Send("!y") Sleep ( 3000 ) Send("Timescan Log.txt") Sleep ( 1 ) Send("!De") Hoping for replys >_<
Developers Jos Posted September 26, 2008 Developers Posted September 26, 2008 (edited) Send(@desktopdir & "\Timescan Log.txt") .. but why not use FileWrite() in stead of using Notepad? Groet, Jos Edited September 26, 2008 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Rawox Posted September 26, 2008 Author Posted September 26, 2008 I don't know how to edit it, could u please post the whole script I can't get this to work
Developers Jos Posted September 26, 2008 Developers Posted September 26, 2008 I don't know how to edit it, could u please post the whole script I can't get this to work >_<Nah.... you have a go and post what you have and what isn't working. (minder werk voor mij) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
TehWhale Posted September 26, 2008 Posted September 26, 2008 (edited) Do what Jos said first! $Hand = FileOpen(@DesktopDir & "\timescan Log.txt", 1) FileWrite($Hand, "-------------------------------------------------------------------------------------------"&@CRLF& _ "| This Scan Was Done By: Computer Sam. |"&@CRLF&"| Computer Sam from: Microsoft Office. |"&@CRLF& _ "| Time past: 13 seconds. |"&@CRLF&"| Type of Scan: Time. |"&@CRLF& _ "| Directory of Saved Log: Desktop |"&@CRLF& _ "-------------------------------------------------------------------------------------------") FileClose($Hand) Edited September 26, 2008 by Alienware
Rawox Posted September 26, 2008 Author Posted September 26, 2008 Tnx Alienware, with some changes I've got it
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