Jump to content

Send() not working in npad example


 Share

Recommended Posts

I was trying out the tutorial script npad, which was working great, except the final line of code Send("!n") does not work. The message box comes up, but the yes button is highlighted and it just hangs there. I have noticed there is an icon on the taskbar, and when I right click on it, it shows the script is paused. Can anyone tell me what I have done wrong? I wasn't able to find anything in the help on pausing or unpausing a script - Thanks!

Link to comment
Share on other sites

Well, what language is your OS ? If it's non-English you will have to modify it to the corresponding titles

and text. Regarding the pause-issue, the script isn't paused before you actually click the tray-icon, so

there's nothing wrong there.

Link to comment
Share on other sites

Well, what language is your OS ? If it's non-English you will have to modify it to the corresponding titles

and text. Regarding the pause-issue, the script isn't paused before you actually click the tray-icon, so

there's nothing wrong there.

I am using Windows XP Pro - English. This is a complete copy of the code I typed:

Run ("notepad.exe")

WinWaitActive ("Untitled - Notepad")

Send ("This is some text")

Winclose ("Untitled - Notepad")

WinWaitActive ("Notepad", "The text in the Unititled file has changed")

Send("!n")

The code just before the last Send executes beautifully. Any ideas what I am doing wrong?

Link to comment
Share on other sites

I'm sorry to sound so dense, but what do you mean? Or was that a haha?

Of course it wasn't a haha. I just ment that perhaps the script requires a short sleep (as in a "wait") before it presses ALT+N, so like this:

Run ("notepad.exe")
WinWaitActive ("Untitled - Notepad")
Send ("This is some text")
Winclose ("Untitled - Notepad")
WinWaitActive ("Notepad", "The text in the Untitled file has changed")
Sleep(250)
Send("!n")

Kurt

Awaiting Diablo III..

Link to comment
Share on other sites

  • Developers

It is exact sience:

you have:

WinWaitActive ("Notepad", "The text in the Unititled file has changed")

should be

WinWaitActive ("Notepad", "The text in the Untitled file has changed")

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

Of course it wasn't a haha. I just ment that perhaps the script requires a short sleep (as in a "wait") before it presses ALT+N, so like this:

Run ("notepad.exe")
WinWaitActive ("Untitled - Notepad")
Send ("This is some text")
Winclose ("Untitled - Notepad")
WinWaitActive ("Notepad", "The text in the Untitled file has changed")
Sleep(250)
Send("!n")

Kurt

Sorry, I didn't know there was a sleep command. Anyway, I inserted that command and it is still doing the same thing. By the way, why does the script add an icon to the tray and not remove it when the script finishes (which it may not be doing?)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...