dallasgfx Posted March 20, 2009 Share Posted March 20, 2009 (edited) hi every buddy i wrote a simple code with this code i can creat a file when i press a button in the clipboard but the code doesn "t work well this is the code plzz help me HotKeySet ("{a}" , "a") func a () FileWrite ("c:\txt.txt" , "hello") EndFunc when i run the code he show and hide fastely plz help me i want the code still show untill i stop it thanks you Edited March 20, 2009 by dallasgfx Link to comment Share on other sites More sharing options...
PsaltyDS Posted March 20, 2009 Share Posted March 20, 2009 hi every buddy i wrote a simple code with this code i can creat a file when i press a button in the clipboard but the code doesn "t work well this is the code plzz help me HotKeySet ("{a}" , "a") func a () FileWrite ("c:\txt.txt" , "hello") EndFunc when i run the code he show and hide fastely plz help me i want the code still show untill i stop it thanks you The script exits because there is nothing to do. Add a while loop to keep the script active: While 1 Sleep(10) WEnd Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Triblade Posted March 20, 2009 Share Posted March 20, 2009 BTW, do you use FileOpen and FileClose somewhere?Quote from Helpfile:The text file must be opened in write mode or the FileWrite command will fail. My active project(s): A-maze-ing generator (generates a maze) My archived project(s): Pong3 (Multi-pinger) Link to comment Share on other sites More sharing options...
dallasgfx Posted March 20, 2009 Author Share Posted March 20, 2009 that's wright my friend but when i press a the word a doesn"t wrote in clipboard i want when i press button a the code creat the file and write the word a thanks you Link to comment Share on other sites More sharing options...
dallasgfx Posted March 20, 2009 Author Share Posted March 20, 2009 but when i press a the word a doesn"t wrote in clipboard i want when i press button a the code creat the file and write the word a thanks you Link to comment Share on other sites More sharing options...
DaRam Posted March 20, 2009 Share Posted March 20, 2009 This thread does not make any sense! ....unless some posts have been deleted, even then.... Link to comment Share on other sites More sharing options...
dallasgfx Posted March 20, 2009 Author Share Posted March 20, 2009 This thread does not make any sense! ....unless some posts have been deleted, even then.... what !! , i want to correct my codewhen i pross button "a" . i want to creat a file and in the samr time write word "a" that's all Link to comment Share on other sites More sharing options...
Developers Jos Posted March 20, 2009 Developers Share Posted March 20, 2009 what !! , i want to correct my codeWhich code?You are not showing anything and we aren't clairvoyant (yet). 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. Link to comment Share on other sites More sharing options...
DaRam Posted March 20, 2009 Share Posted March 20, 2009 Try this... Global Const $filename = "c:\txt.txt" HotKeySet ("{a}" , "a") While 1 ; Wait to Exit Wend ; ShellExecute($filename, "", @ScriptDir, "edit") func a () $file = FileOpen($filename, 1) ; Check if file opened for writing OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file." & @CRLF & $filename) Exit EndIf FileWrite ($file , "hello") FileClose($file) EndFunc Link to comment Share on other sites More sharing options...
GEOSoft Posted March 20, 2009 Share Posted March 20, 2009 Which code?You are not showing anything and we aren't clairvoyant (yet).Question. Why don't we have a clairvoyant() function in AutoIt yet? 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...
GEOSoft Posted March 20, 2009 Share Posted March 20, 2009 Could you at least show an example of what you want written to the file and what you want written to the clipboard? If you want to place something on the clipboard then you use ClipPut("Something"). If you want to append something to the clipboard then use ClipPut(ClipGet() & "Something") and make sure that you empty the clipboard first by using ClipPut("") 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...
dallasgfx Posted March 20, 2009 Author Share Posted March 20, 2009 you didn "t get me wright i want when i ckikc button "a" the file creat and the word "a" put normale Link to comment Share on other sites More sharing options...
GEOSoft Posted March 20, 2009 Share Posted March 20, 2009 Show some example code. That's my final answer. If you can't provide us with more details then I have a feeling the thread will be locked before you ever get a reply. 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...
dallasgfx Posted March 20, 2009 Author Share Posted March 20, 2009 HotKeySet ("{a}" , "a") While 1 Sleep(10) WEnd func a () FileWrite ("c:\txt.txt" , "hello") EndFunc Link to comment Share on other sites More sharing options...
DaRam Posted March 20, 2009 Share Posted March 20, 2009 Did you even try the code I posted here #659015? you didn "t get me wrighti want when i ckikc button "a" the file creat and the word "a" put normale Link to comment Share on other sites More sharing options...
DaRam Posted March 20, 2009 Share Posted March 20, 2009 You cannot write to a file that has not been opened ! HotKeySet ("{a}" , "a") While 1 Sleep(10) WEnd func a () FileWrite ("c:\txt.txt" , "hello") EndFunc Link to comment Share on other sites More sharing options...
dallasgfx Posted March 20, 2009 Author Share Posted March 20, 2009 Did you even try the code I posted here #659015? i try your code but when i click in button "a" it doesn"t write "a" it just creat the file Link to comment Share on other sites More sharing options...
GEOSoft Posted March 20, 2009 Share Posted March 20, 2009 (edited) You cannot write to a file that has not been opened !Oh yes you can. It's not a good practice but it can be done. $hFile = @DesktopDir & "\mytest.txt" For $i = 1 to 10 FileWriteLine($hFile, $i) Next ShellExecute($hFile) Edited March 20, 2009 by GEOSoft 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...
DaRam Posted March 20, 2009 Share Posted March 20, 2009 If I did not know different, I would swear you are trolling this forum ! In the code, Change FileWrite ($file , "hello") to FileWrite ($file , "a")i try your code but when i click in button "a" it doesn"t write "a" it just creat the file Link to comment Share on other sites More sharing options...
GEOSoft Posted March 20, 2009 Share Posted March 20, 2009 My new Clairvoyant() function tells me that this thread is becoming totally useless. 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...
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