Sign in to follow this  
Followers 0
patgenn123

Window Title

8 posts in this topic

Hello all! Newbie here.

I have a quick question.

I am interested in creating an AutoIt Script that "fires" when a Window Title appears.

Do I need to create an AutoIt script and move it to the startup folder in order to have an active AutoIt script that monitors Window Titles and "self trigger"?

Thanks!

-P

Share this post


Link to post
Share on other sites



Hello all! Newbie here.

I have a quick question.

I am interested in creating an AutoIt Script that "fires" when a Window Title appears.

Do I need to create an AutoIt script and move it to the startup folder in order to have an active AutoIt script that monitors Window Titles and "self trigger"?

Thanks!

-P

what exactly do you mean?

That when a certain window opens your program starts if so heres the code

winwaitactive("Your title goes here")

READ BEFORE POSTINGMy UDF'sMessagesYou say plz because its shorter than please. I say no because its shorter than yes.Join My Website

Share this post


Link to post
Share on other sites

Thanks for the reply!

I know the code. I am trying to learn the program.

I learned a little scripting from MacroExpress( a macro program). I don't know much about AutoIt yet. With MacroExpress, MacroExpress is "running" in the System tray. While this is in the System tray, this program constantly monitors for things like "Windows title" to run its macros DEPENDING on what I program it to watch for.

For example, if the Excel Window Title opens, if I have a macro to run based on that title, it automatically fires.

How is this set up in AutoIt?

-P

Share this post


Link to post
Share on other sites

Like he said, WinWaitActive()

Look it up in the helpfile.

It pauses the script untill a certain window is up and active, in other words it waits for a window


[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

OK. I want to thank the both of you for answering my "noob" question. If any question is idiotic(because I have no knowledge, please feel free to slap me!)

Anyway, I tried this simple script To login to a database with a password:

WinWaitActive("Log on to Personal2008", "", 5)

Sleep(1000)

Send(565656)

The only way it worked was "clicking" on the AutoIt icon. It typed "565656", but only when I clicked on the icon. this is a far cry from "auto detecting" the window title and autotyping the login password.

What is this "noob" missing to get this to constantly run and when the Window "Log on to Personal2008" popsup, to type the password in?

if that's an idiot question(self deprecating), then let me know!

-P

Edited by patgenn123

Share this post


Link to post
Share on other sites

ah, well WinWaitActive() also requires that the window is the most active one(like, on the very top)

Plus you set the timeout to 5 seconds, which means it will stop waiting after 5 seconds.

Try this:

Do

Sleep(1000)

Until WinExist(""Log on to Personal2008")

WinActivate("Log on to Personal2008")

Sleep(500)

Send("565656")

oops, looks like I accidentally wrote it for you... well, i'll throw in a bug for you to fix on your own then, lol


[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Share this post


Link to post
Share on other sites

Hey! Thanks! The bug was that extra " in line 3. Right?

Yet, it still doesn't work.

Shouldn't this be in the system tray for it to "monitor" what's going on?

Gosh, I wish I had some programming experience. if I had the chance to do things all over again, I would have gone to school for this. Or at least started earlier in my life.

What next?

-P

Share this post


Link to post
Share on other sites

perhaps it is not the recognition of the window, rather the script is not typing into the right place.

Perhaps you are not "send"ing into the right box?

Look up ControlSend, with the aid of the Autoit Window tool.

I'm not sure whats the problem.... is autoit atleast bringing up the window?

Run This

Do

Sleep(1000)

Until WinExist(""Log on to Personal2008")

WinActivate("Log on to Personal2008")

Sleep(500)

MsgBox(0,"Test!","I see it!")

Send("{TAB}565656")

MsgBox(0,"Test!","I tried typing, did it work?")

If the message box says "I see it!" Then that means it is atleast recognizing the window.

If it worked, then it will try pressing TAB then typing, TAB selects the nearest control

If it DIDNT work, then use the AutoIt Window tool and check the window's title and make sure you got it right.

If it didn't work even after that, use to autoit tool again to find the name of the control (the input box)

Then you can use ControlSend() or ControlSetText()

You can ask about that here too, but I think the Autoit Help file has it down anyway..

*yawn* i'm gonna go to sleep, I'll reply tomorrow morn


[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

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  
Followers 0