Skaboufar Posted February 25, 2005 Share Posted February 25, 2005 Hi pretty new to thsi autoit, i havent been working with it since V2, and my memory is pretty bad. So now im about to start with it again. So here is my question how do i, copy a part of a text from a file without opening the file. And paste in the window that is active at the time. Whould it be more easy to copy a section from a ini file ? I hope some of you could help me on this, a little example code. Best regards ME. Link to comment Share on other sites More sharing options...
Insolence Posted February 25, 2005 Share Posted February 25, 2005 Look in the help file for 'FileRead' and get back here if you need more help (kinda busy, but if you need it I don't mind ) "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar. Link to comment Share on other sites More sharing options...
Skaboufar Posted February 25, 2005 Author Share Posted February 25, 2005 Look in the help file for 'FileRead' and get back here if you need more help (kinda busy, but if you need it I don't mind )<{POST_SNAPBACK}>Weel i got so far that i can make it write the txt into the aplication.But it makes a extra line break (On line break + the line thats allready is i the file)so far my codes looks like thisHotKeySet("^!x", "Exit") HotKeySet("{PAUSE}", "Insert") $file = FileOpen("Text.txt", 0) Func MyExit() Exit EndFunc If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf Func insert() While 1 $Text = FileRead($file, 1) If @error = -1 Then ExitLoop send ($Text) Wend fileclose ($file) EndFunc Link to comment Share on other sites More sharing options...
Andre Posted February 25, 2005 Share Posted February 25, 2005 Hi, Try this ? HotKeySet("^!x", "Exit") HotKeySet("{PAUSE}", "Insert") $file = FileOpen("Text.txt", 0) Func MyExit() Exit EndFunc If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf Func insert() While 1 $Text = FileRead($file, 1) If @error = -1 Then ExitLoop send (StringStripCR($Text)) Wend fileclose ($file) EndFunc 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