Jump to content
Sign in to follow this  
Tomohashi

Designating to Wait for a Window

Recommended Posts

Tomohashi

Ok, I'm trying to code something for AIM that when someone sends something to me, it responds with a couple of lines.

I have the code written, but I need to make it wait for the AIM window. And if you know AIM, it has a different title for every window, for instance: "ScreenName - Instant Message". Is there a way to put in like a 'wild card' character?

Also, I need this script to do this every time a window comes up. Do I need a loop? I already have it closing the window after the messages are send.

Thanks.

Share this post


Link to post
Share on other sites
martin

Ok, I'm trying to code something for AIM that when someone sends something to me, it responds with a couple of lines.

I have the code written, but I need to make it wait for the AIM window. And if you know AIM, it has a different title for every window, for instance: "ScreenName - Instant Message". Is there a way to put in like a 'wild card' character?

Also, I need this script to do this every time a window comes up. Do I need a loop? I already have it closing the window after the messages are send.

Thanks.

Look in Help for wintextmatchmode.

just check if the window exists in your main while loop if you've got one. Then if it exists do whatever.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
MHz

Advanced Window Descriptions

A special description can be used as the window title parameter. This description can be used to identify a window by the following properties:

TITLE - Window title

CLASS - The internal window classname

REGEXPTITLE - Window title using a regular expression

LAST - Last window used in a previous AutoIt command

ACTIVE - Currently active window

INSTANCE - The 1-based instance when all given properties match

:)

Share this post


Link to post
Share on other sites
Tomohashi

Ah. Thanks and kudos to both of you, that helps quite a bit.

EDIT: Would this be it?

AutoItSetOption("WinTextMatchMode",3)

$x= 1

While $x=1

winWaitActive( "-Instant Message" )

Send("Message1.")

Send("{ENTER}")

Sleep(5000)

Send("Message2.")

Send("{ENTER}")

WEnd

Edited by Tomohashi

Share this post


Link to post
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
Sign in to follow this  

×