wanttolearn Posted February 8, 2005 Share Posted February 8, 2005 Hi, I'd like to open notepad, write to it and save it. I believe I know how to do that. What I want to be able to do is to make sure I'm in the directory I want the notepad file to be saved in. Is there a way when I'm saving my file to specify the directory/folder and/or can I just set up the directory/folder before I even run Notepad? I'd rather just change my directory, write my notepad file and save it. I don't know how to change my directory while I'm using the gui and not cmd. Also, is there an autoit tutorial web site. I don't want to bother you all with what I know is very basic code for most of you. thanks Link to comment Share on other sites More sharing options...
Andre Posted February 8, 2005 Share Posted February 8, 2005 Hi, Just a dumb question. You want to write to an text file using Notepad ? why ? In AutoIt u can do the same with FileWriteLine for example. Andre What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel! Link to comment Share on other sites More sharing options...
Andre Posted February 8, 2005 Share Posted February 8, 2005 Sorry, here is an example.. $file = FileOpen("test.txt", 1) ; Check if file opened for writing OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileWriteLine($file, "Line1") FileWriteLine($file, "Line2" & @CRLF) FileWriteLine($file, "Line3") FileClose($file) Andre What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel! Link to comment Share on other sites More sharing options...
closeupman Posted February 8, 2005 Share Posted February 8, 2005 If you check the help file(use the index and look up under @) there are several things u can do to specify or get the directy (e.g. @scriptdir)Hi,I'd like to open notepad, write to it and save it. I believe I know how to do that. What I want to be able to do is to make sure I'm in the directory I want the notepad file to be saved in. Is there a way when I'm saving my file to specify the directory/folder and/or can I just set up the directory/folder before I even run Notepad? I'd rather just change my directory, write my notepad file and save it. I don't know how to change my directory while I'm using the gui and not cmd.Also, is there an autoit tutorial web site. I don't want to bother you all with what I know is very basic code for most of you.thanks<{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
wanttolearn Posted February 8, 2005 Author Share Posted February 8, 2005 Hi,Just a dumb question.You want to write to an text file using Notepad ? why ?In AutoIt u can do the same with FileWriteLine for example.Andre<{POST_SNAPBACK}>I want to write to notepad to save a file with a name I know. Then I'm going to FTP to another machine and send this file. I can already write the notepad file, save it and FTP it to another machine. But I'm running my autoit program from the same directory. I want to run my autoit program from anywhere, and select the file I want to be in to store my notepad file. (the file I created)thanks Link to comment Share on other sites More sharing options...
wanttolearn Posted February 8, 2005 Author Share Posted February 8, 2005 Hi,Just a dumb question.You want to write to an text file using Notepad ? why ?In AutoIt u can do the same with FileWriteLine for example.Andre<{POST_SNAPBACK}>Also, it doesn't matter what is in the notepad text file. I'm just typing some info and then saving it with a name that I need to use further down in the program.I do not want to type anything in myself, I just want to run the program and have it do it all.thanks Link to comment Share on other sites More sharing options...
Blue_Drache Posted February 8, 2005 Share Posted February 8, 2005 (edited) I want to write to notepad to save a file with a name I know. Then I'm going to FTP to another machine and send this file. I can already write the notepad file, save it and FTP it to another machine. But I'm running my autoit program from the same directory. I want to run my autoit program from anywhere, and select the file I want to be in to store my notepad file. (the file I created)thanks<{POST_SNAPBACK}>What (I think) Andre is saying is "Why bother with Notepad?" Adding an extra program in will slow it down and increase the possiblity of errors.AutoIt can directly write text to a file without the use of an outside editor like *pad.I guess I'm just as confused as Andre Edited February 8, 2005 by Blue_Drache Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
wanttolearn Posted February 8, 2005 Author Share Posted February 8, 2005 What (I think) Andre is saying is "Why bother with Notepad?" Adding an extra program in will slow it down and increase the possiblity of errors.AutoIt can directly write text to a file without the use of an outside editor like *pad.I guess I'm just as confused as Andre<{POST_SNAPBACK}> It clicked!!!!ThanksI just did this$file = FileOpen("c:\test2.txt", 1)and I do have the file in the directory I intend for it to be in.Thanks Andre and you too Blue_Drache Link to comment Share on other sites More sharing options...
Andre Posted February 8, 2005 Share Posted February 8, 2005 Sometimes it's harder to say want you want then to give an answer Andre What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel! 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