Jump to content

Recommended Posts

Posted (edited)

Any idea why this works:

$win = WinGetPos ( "[Active]" )

and this doesn't:

$win = WinGetPos ( "Untitled - Notepad" )

Even tried portions of the name, as in "Un" and it still won't find the window. The first one works, you just have to make sure that the window you want to read from is made active first. I've looked through the description of the command and haven't spotted anything that might indicate I am doing something wrong but then that's me all over. :)

Edited by Memnoch
Posted

  Memnoch said:

Any idea why this works:

$win = WinGetPos ( "[Active]" )

and this doesn't:

$win = WinGetPos ( "Untitled - Notepad" )

Even tried portions of the name, as in "Un" and it still won't find the window. The first one works, you just have to make sure that the window you want to read from is made active first. I've looked through the description of the command and haven't spotted anything that might indicate I am doing something wrong but then that's me all over. :)

Works this?

Opt("WinTitleMatchMode", 2)

$win = WinGetPos ( "Notepad" )
Posted (edited)

Sorry! It was me. The script was running through so fast that Notepad, at that point, was not even open. Putting in a simple WinWaitActive, or indeed a WinExists loop, fixed it. Thanks for your reply anyway. I knew I was missing something as I've never had problems with that before. :)

Edited by Memnoch

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
  • Recently Browsing   0 members

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