Newbie2 Posted April 6, 2004 Share Posted April 6, 2004 Hi Guys, I'm a little confused here... Run ("Notepad") Sleep (2000) $word=('AB+CD') msgbox (0,"",$word); This is OK! send ($word); why? I wanted AB+CD! I want that $word will be exactly the same as the chars sent to notepad. Is it possible? Link to comment Share on other sites More sharing options...
Developers Jos Posted April 6, 2004 Developers Share Posted April 6, 2004 (edited) A + means Shift in a send string so if you want to send the + you need to specify it as {+} so in your case: Run ("Notepad") Sleep (2000) $word=('AB{+}CD') send ($word) Edit: or send the text RAW like this: Run ("Notepad") Sleep (2000) $word=('AB+CD') msgbox (0,"",$word send ($word,1) Edited April 6, 2004 by JdeB 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...
Newbie2 Posted April 6, 2004 Author Share Posted April 6, 2004 10x, JdeB. I knew that. I'll explain a little more. I want to send some text into a text file (using notepad), save the file and then, using 'FileReadLine', to read each line and compare each line to what was sent. I have coded all this already and it works OK with all chars. The problem is with the '+' sign. e.g. Run ("Notepad") Sleep (2000) $word=string ("AB@CD") msgbox (0,"",$word); all fine! the msgbox displays AB@CD send ($word); all fine too AB@CD is sent to the window But if I use {}Sleep (2000) $word=string ("AB{+}CD") msgbox (0,"",$word); all fine! the msgbox displays AB+CD send ($word); NOT OK! ABCD is sent to the window. The comparation will fail! Is there another way? Link to comment Share on other sites More sharing options...
Valik Posted April 6, 2004 Share Posted April 6, 2004 Then as JdeB pointed, out, send the raw characters. Link to comment Share on other sites More sharing options...
Newbie2 Posted April 6, 2004 Author Share Posted April 6, 2004 :iamstupid: Felling kind of ashamed. What are RAW characters? Link to comment Share on other sites More sharing options...
Valik Posted April 6, 2004 Share Posted April 6, 2004 Read the Send section of the help file and have a look at the optional second parameter of the Send command. Link to comment Share on other sites More sharing options...
Newbie2 Posted April 6, 2004 Author Share Posted April 6, 2004 10x, Valik. That did it. Link to comment Share on other sites More sharing options...
scriptkitty Posted April 6, 2004 Share Posted April 6, 2004 (edited) Run ("Notepad") Sleep (2000) $word=('AB+CD') msgbox (0,"",$word); This is OK! send ($word,1); flag = 1, keys are sent raw. Send -------------------------------------------------------------------------------- Sends simulated keystrokes to the active window. Send ( "keys" [, flag]) Parameters keys The sequence of keys to send. flag [optional] Changes how "keys" is processed: flag = 0 (default), Text contains special characters like + and ! to indicate SHIFT and ALT key presses. flag = 1, keys are sent raw.edit, dang I got to this a bit late it looks like. Edited April 6, 2004 by scriptkitty AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
GrahamS Posted April 7, 2004 Share Posted April 7, 2004 edit, dang I got to this a bit late it looks like.Maybe, but you saved lazy people like me from having to go and look up what Valik was talking about GrahamS Link to comment Share on other sites More sharing options...
Valik Posted April 7, 2004 Share Posted April 7, 2004 Maybe, but you saved lazy people like me from having to go and look up what Valik was talking about Which kind of sucks since I hate when people are too lazy to look something up when it's right in front of their face. 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