Sign in to follow this  
Followers 0
Altrez

!n fuction will not work

4 posts in this topic

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!

Share this post


Link to post
Share on other sites



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!!!!

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 by 99ojo

Share this post


Link to post
Share on other sites

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!!!

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0