Snarg Posted February 23, 2004 Share Posted February 23, 2004 Success: Returns a file "handle" or use with subsequent file functions.How do I know the name of the 'handle'? I would like to open a file and then read from it, but I don't know what to put as the file handle after I open it. FileReadLine ( filehandle or "filename" [, line] ) What do I put in the bold area? A little reading goes a long way. Post count means nothing. Link to comment Share on other sites More sharing options...
Valik Posted February 23, 2004 Share Posted February 23, 2004 $hFile = FileOpen("your file") If $hFile = -1 Then Exit; Failed to open the file $szLine = FileReadLine($hFile) The handle is the return value of FileOpen. -1 indicates failure. Link to comment Share on other sites More sharing options...
Snarg Posted February 23, 2004 Author Share Posted February 23, 2004 Thank you. A little reading goes a long way. Post count means nothing. Link to comment Share on other sites More sharing options...
Snarg Posted February 24, 2004 Author Share Posted February 24, 2004 (edited) Sorry for the stupid questions, this is my first time using Version 3. Ok, I see how to set a HotKey, that's pretty easy. Now I would like my script to pause untill a hotkey is pressed. How would I go about that? Edit: Ok, another question. I would like to send a set line of text, a variable, and then the Enter key. This is what I have: Send ("Text" & $Variable & '{ENTER}') It sends the text and the variable but does not press the enter key at the end. I have tried many variations of it with no luck. Any help is greatly appreciated. Peeee Essss I didn't want to start a whole new topic for something so stupid Edited February 24, 2004 by Snarg A little reading goes a long way. Post count means nothing. Link to comment Share on other sites More sharing options...
CyberSlug Posted February 24, 2004 Share Posted February 24, 2004 This should help accomplish what you want. Global $PAUSED = 0 ; 1 = paused, 0 = not paused HotKeySet("{Pause}", "TogglePauseState") ; body of script would go here ; To start the script in a paused state, ; you would say Call("TogglePauseState") Exit Func TogglePauseState() $PAUSED = Not $PAUSED ;toggle While $PAUSED Sleep(100) WEnd EndFunc I have no idea why the send is failing; it looks right. Where are you trying to send the text to? You might try using ControlSend (see help file). Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
CyberSlug Posted February 24, 2004 Share Posted February 24, 2004 Larry pointed out something I forgot. Try this:Send ("Text" & $Variable , 1)Send("{Enter}")The optional parameter, 1, forces the "raw" text to be sent. Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
Snarg Posted February 24, 2004 Author Share Posted February 24, 2004 Oddly enough, this send works: Send ("text" & $variable & "{ENTER}") Thank you for your help. A little reading goes a long way. Post count means nothing. Link to comment Share on other sites More sharing options...
CyberSlug Posted February 24, 2004 Share Posted February 24, 2004 Oddly enough, this send works:Send ("text" & $variable & "{ENTER}")Are you saying that it works when {Enter} is enclosed in double quotes but does not work when enclosed in single quotes?!?Try it again, please, and let us know. Perhaps there is some AutoIt bug Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
Snarg Posted February 24, 2004 Author Share Posted February 24, 2004 Are you saying that it works when {Enter} is enclosed in double quotes but does not work when enclosed in single quotes?!?Try it again, please, and let us know. Perhaps there is some AutoIt bug That's odd. It works both ways. Bizzare. A little reading goes a long way. Post count means nothing. Link to comment Share on other sites More sharing options...
Valik Posted February 24, 2004 Share Posted February 24, 2004 That's odd. It works both ways. Bizzare.Its not odd. What CyberSlug was trying to convey is this:$var = "{SPACE}"Send("abcd" & $var & "efgh")Instead of sending the characters {,S,P,A,C,E,} as you might think, it interprets that as {SPACE}.Output would be: abcd efghUsing Send("abcd" & $var & "efgh", 1) tells it to send the characters raw, so none of the special {<word>} type things work.Output: abcd{SPACE}efghIn relevance to your situation, if $var would of contained a { or something, it would pretty much mess up all the rest of the stuff being sent in that line. So this will work as long as there is no { or a properly constructed {<word>} item in $var:Send("test" & $var & "{ENTER}") 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