Jump to content

WinActive naming


Recommended Posts

Hi guys,

I am trying to write a script that will detect when someone sends me a message through msn messenger. I will use the name "Gary" as an example.

When a message is received, a window is created with the title

"Gary - Conversation"

My concern is not with the script itself - its just with the handling of the windows

right now - this works (doesn't do anything except Activate and then close the window - but thats all I wanted)

Can I somehow make this for ANY window that ENDS in "- Conversation" (so not just for Gary -- but for anyone who sent a message)

While 1=1

WinActivate("Gary - Conversation")

Send ("Test")

WinClose("Gary - Conversation")

Sleep(2000)

Wend

Link to comment
Share on other sites

Hi guys,

I am trying to write a script that will detect when someone sends me a message through msn messenger.  I will use the name "Gary" as an example.

When a message is received, a window is created with the title

"Gary - Conversation"

My concern is not with the script itself - its just with the handling of the windows

right now - this works (doesn't do anything except Activate and then close the window - but thats all I wanted)

Can I somehow make this for ANY window that ENDS in "- Conversation" (so not just for Gary -- but for anyone who sent a message)

While 1=1

WinActivate("Gary - Conversation")

Send ("Test")

WinClose("Gary - Conversation")

Sleep(2000)

Wend

<{POST_SNAPBACK}>

Opt("WinTitleMatchMode",2)

WinExists("- Conversation")
$title_convo = WinGetTitle("- Conversation")

While 1
   WinActivate($title_convo)
   Send("Test!S",0); !S is Alt+S or the default send function on most chatters
   WinClose($title_convo)
   Sleep(2000)
WEnd

and wrap your code in [.code] [./code] (no period). It makes it easier to identify and read. It also keeps any formatting you put in.

Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

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