Welsh Posted April 3, 2010 Share Posted April 3, 2010 Hey All, Just a quick question regarding FileWrite, I was wondering if it would be possible to use whatever I've just copied from a command window, and then using FileWrite, write that to a file (I guess flush out the copy/paste buffer to the file). Right now I have I have a script that is just copy and pasting to a notepad file from a command window but was wondering if I could skip that step and just write it directly to a file. Not sure if it is possible but thought I'd ask, did a quick search but didn't find anything. Thanks, Welsh [center].: If I Ask A Question, Thanks For The Help! :.[/center][center].: Welsh :.[/center] Link to comment Share on other sites More sharing options...
ForsakenGod Posted April 3, 2010 Share Posted April 3, 2010 Well where is the problem whe you know what you want to do ? : ) $towrite = ClipPut($yourdata) FileOpen($file) FileWrite($file,$towrite & @Crlf) FileClose($file) You can define the text you put into clip as variable and then write it to a file Link to comment Share on other sites More sharing options...
Welsh Posted April 3, 2010 Author Share Posted April 3, 2010 Well, I knew what I wanted to do, but not how to do it. But as soon as you said ClipPut I found ClipGet which helps me do exactly what I want to do! Thanks Alot [center].: If I Ask A Question, Thanks For The Help! :.[/center][center].: Welsh :.[/center] Link to comment Share on other sites More sharing options...
GEOSoft Posted April 3, 2010 Share Posted April 3, 2010 Well where is the problem whe you know what you want to do ? : ) $towrite = ClipPut($yourdata) FileOpen($file) FileWrite($file,$towrite & @Crlf) FileClose($file) You can define the text you put into clip as variable and then write it to a file Now test what you posted with $yourdata = "This is some data." $towrite = ClipPut($yourdata) MsgBox(0, "Oooops", $towrite) ;FileOpen($file) ;; This should require a mode flag to be set. Either 1 to append or 2 to erase the previous contents then write ;FileWrite($file,$towrite & @Crlf) ;FileClose($file) Fortunatly the OP was observant when he checked the help file. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
ForsakenGod Posted April 3, 2010 Share Posted April 3, 2010 I d like to respond but this thingy in your sig tells everythink "In theory, theory and practice are the same. In practice, they are not." - Albert Einstein I am sorry i did not check my source but he at least got the idea . I writed it fast because i had go make smthink else (well at least i tryed to help) 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