Lakes Posted November 2, 2006 Share Posted November 2, 2006 Run("notepad.exe") ControlSend("Untitled - Notepad", "", "Edit1", "This is a line of text in the notepad window") Exit Can someone tell me why all of a sudden, this simple most basic script, only sends text to a previous notepad window and not one the script opens??? This is Nuts!! 2015 - Still no flying cars, instead blankets with sleeves. Link to comment Share on other sites More sharing options...
Developers Jos Posted November 2, 2006 Developers Share Posted November 2, 2006 Run("notepad.exe") ControlSend("Untitled - Notepad", "", "Edit1", "This is a line of text in the notepad window") ExitoÝ÷ Ø&§²¢wzYf{rjYh}«.uק¶¬²)©é¨²ÖÚ²',r¸©¶åÊǧvË^ÆÛhjÞ¾*.²z-zÂ)Ý£§vz-¢wë®*m¢§±8b²+ ºÛ7ß}ÿªê-y.j·§¢Üاú+6^¥§m¢ËZ®Û©jëh×6Run("notepad.exe") Sleep(500) ControlSend("Untitled - Notepad", "", "Edit1", "This is a line of text in the notepad window") Exit 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...
smstroble Posted November 2, 2006 Share Posted November 2, 2006 (edited) it may be doing the control send faster than notepad can start. try putting a sleep(700) or something like that in there. EDIT: Bah JdeB beat me by a second or 2 Edited November 2, 2006 by smstroble MUHAHAHAHAHA Link to comment Share on other sites More sharing options...
Lakes Posted November 2, 2006 Author Share Posted November 2, 2006 slow down geronimo... literally... Run("notepad.exe") WinWait("Untitled - Notepad") ControlSend("Untitled - Notepad", "", "Edit1", "This is a line of text in the notepad window") Exit Thanks Guys, sometimes the obvious tends to be elusive.. 2015 - Still no flying cars, instead blankets with sleeves. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 2, 2006 Moderators Share Posted November 2, 2006 Thanks Guys, sometimes the obvious tends to be elusive..May even want to take it a step further in case you currently have an Untitled notepad window open$iPID = Run("notepad.exe") ProcessWait($iPID) WinWaitActive("Untitled - Notepad") ControlSend("Untitled - Notepad", "", "Edit1", "This is a line of text in the notepad window") Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Blue_Drache Posted November 2, 2006 Share Posted November 2, 2006 (edited) May even want to take it a step further in case you currently have an Untitled notepad window open$iPID = Run("notepad.exe") ProcessWait($iPID) WinWaitActive("Untitled - Notepad") ControlSend("Untitled - Notepad", "", "Edit1", "This is a line of text in the notepad window") As written, your code: ProcessWait($iPID) will fail. Remarks Process names are executables without the full path, e.g., "notepad.exe" or "winword.exe" In order to work under Windows NT 4.0, ProcessWait requires the file PSAPI.DLL (included in the AutoIt installation directory). The process is polled approximately every 250 milliseconds. This function is the only process function not to accept a PID. Because PIDs are allocated randomly, waiting for a particular PID to exist doesn't make sense. Edited November 2, 2006 by Blue_Drache Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache 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