Skoezzi Posted December 19, 2005 Posted December 19, 2005 I got following code: Send("#r") WinWaitActive("Run") Send("notepad.exe{Enter}") WinWaitActive("Untitled -") Send("Today's time/date is {F5}") It works till he has to open notepad.exe. What do i do wrong? Always when I try to send text to a inputfield, my script pauses. Can anybody help me?
Bert Posted December 19, 2005 Posted December 19, 2005 (edited) run notepad with AutoItSetOption("WinTitleMatchMode", 2) run("notepad") winwait("Notepad") WinActivate("Notepad") send("{F5}") This is one way...I'm sure there are other ways of doing it. Edited December 19, 2005 by vollyman The Vollatran project My blog: http://www.vollysinterestingshit.com/
MHz Posted December 19, 2005 Posted December 19, 2005 Can anybody help me?Wish I could help but your code works every time .
Skoezzi Posted December 19, 2005 Author Posted December 19, 2005 Wish I could help but your code works every time .I just can't paste text into a textbox. The rest seems to work only the Send("text") does not work for me.
MHz Posted December 19, 2005 Posted December 19, 2005 (edited) Are the titles correct for your system ? Try this example: Opt('TrayIconDebug', 1) Send("#r") WinWaitActive("Run") Send("notepad.exe{Enter}") Sleep(1000) $title = WinGetTitle('') WinWaitActive($title) Send("Today's time/date is {F5}") MsgBox(0, '', 'Title = ' & $title) Edit: forget the & in code Edited December 19, 2005 by MHz
Skoezzi Posted December 19, 2005 Author Posted December 19, 2005 (edited) Are the titles correct for your system ? Try this example: Opt('TrayIconDebug', 1) Send("#r") WinWaitActive("Run") Send("notepad.exe{Enter}") Sleep(1000) $title = WinGetTitle('') WinWaitActive($title) Send("Today's time/date is {F5}") MsgBox(0, '', 'Title = ' & $title) Edit: forget the & in codeThis code just opens a Run box. What do you mean with : Are the titles correct for your system? EDIT: It works! It were the titles indeed. Thanks mate! Edited December 19, 2005 by Skoezzi
MHz Posted December 19, 2005 Posted December 19, 2005 This code just opens a Run box. What do you mean with : Are the titles correct for your system?As for titles, do they match correctly. You are running an English operating system ? Perhaps the sleep was not long enough in last example. Try your original code as set here and if it is stuck on a line then hover your mouse over the system tray icon to see which line is the problem. Opt('TrayIconDebug', 1) Send("#r") WinWaitActive("Run") Send("notepad.exe{Enter}") WinWaitActive("Untitled -") Send("Today's time/date is {F5}")
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