Jump to content

Strange behavior when running a script


 Share

Recommended Posts

I encountered some strange behavior when running the script below:

; Script Start - Add your code below here

; Run("notepad.exe")dont need this as Notepad will be opened manually before running the script

; WinWaitActive("Untitled - Notepad")same as above

Send("This is some text.")

WinMove("Untitled - Notepad", "", 20, 20, 400, 300)

Sleep(2000)

WinSetState("Untitled - Notepad", "", @SW_MAXIMIZE)

Sleep(2000)

WinSetState("Untitled - Notepad", "", @SW_RESTORE)

sleep(2000)

WinMove("Untitled - Notepad", "", 500, 250, 640, 480)

Basically if an Untitled Notepad is already created and running in Window mode (not Minimized or Maximized) and I execute this script, everything works fine. But if I maximize the same Notepad and run the script, it skips the Maximizing and Restoring steps and goes to the last Winmove step. Further more, looks like some keys got stuck after I closed the Notepad as I could not double click to open the notepad file again. On the first double click on the Notepad, nothing happened, and on the second double click on the Notepad, I got a Property window open instead of the Notepad...

Definitely a newbie question as you can see, and hopefully there is a solution. Hope someone can help... Thanks in advance

Edited by masterng
Link to comment
Share on other sites

Hmm... This might be a bug... After resizing a maximized window it looks like the window doesn't realize it's not full screen any more, which means it doesn't have an icon for maximize and instead has an icon for restore...

My first script and already ran into a bug... :D Any way to work around this?

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