Altrez Posted September 30, 2009 Share Posted September 30, 2009 Hello All, I am trying to run this script. MsgBox(0, "Notepad", "Here we go!") Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send("This is some text.") WinClose("Untitled - Notepad") WinWaitActive("Notepad", "Do you want to save") Send("!n") And it work fine until it reaches the Send function for alt+n. It will not send the key commands to close notepad. I am running Vista Home basic. Any ideas? Thanks! Link to comment Share on other sites More sharing options...
Altrez Posted September 30, 2009 Author Share Posted September 30, 2009 I also cannott seem to lunch excel.exe with this script. Run("excel.exe") If I go to start run and type excel.exe it works perfectly. However when I try to add it to my script it just hangs? Here is the code: Run("excel.exe") WinWaitActive("Book1 - Microsoft Excel") Send("Test.") It would seem that this is very basic functionality so I am not sure why it is not working. Any help at all would be great. Thanks!!!! Link to comment Share on other sites More sharing options...
99ojo Posted September 30, 2009 Share Posted September 30, 2009 (edited) Hello All, I am trying to run this script. MsgBox(0, "Notepad", "Here we go!") Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send("This is some text.") WinClose("Untitled - Notepad") WinWaitActive("Notepad", "Do you want to save") Send("!n") And it work fine until it reaches the Send function for alt+n. It will not send the key commands to close notepad. I am running Vista Home basic. Any ideas? Thanks! Hi, this should work: MsgBox(0, "Notepad", "Here we go!") Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send("This is some text.") WinClose("Untitled - Notepad") WinWaitActive("Notepad") Send("!n") ;-)) Stefan P.S: For starting excel you should use ShellExcute or the user defined functions for excel. See helpfile _Excel*. Edited September 30, 2009 by 99ojo Link to comment Share on other sites More sharing options...
Altrez Posted September 30, 2009 Author Share Posted September 30, 2009 Hi, this should work: MsgBox(0, "Notepad", "Here we go!") Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send("This is some text.") WinClose("Untitled - Notepad") WinWaitActive("Notepad") Send("!n") ;-)) Stefan P.S: For starting excel you should use ShellExcute or the user defined functions for excel. See helpfile _Excel*. OMG thank you that worked perfectly for notepad. I will check the helpfile for _Excel! Thank you so much!!! 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