Jump to content

Recommended Posts

Posted

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!

Posted

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.

Posted

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?

Posted

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

  • Developers
Posted

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.
  :)

Posted

Unititled ? How about Untitled instead ? :)

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

If you copied that script directly from the helpfile without modifying it then you might have a old version

of AutoIt installed, where this typo hadn't been fixed.

Posted

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?)

Posted

Thanks everyone. I didn't notice the typo. Once I corrected it, it ran beautifully. Is there any place where I can get more sample code to help me learn the commands? Thanks again!

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
×
×
  • Create New...