Jump to content

Recommended Posts

Posted

How to check and activate commands only when active window has specific words in them.

Windows that have different words in them sometimes like

Untitled - Notepad

Example1 - Notepad

Only when active window has Notepad in it?

Posted

Check the help file under "Window Titles and Text (Advanced)", and the CLASS or RegExpTitle specifications.

:mellow:

Thank you, got what I needed using this code

Opt("WinTitleMatchMode", 2)

with

if WinActive("Chat Window","") = True Then

Posted

The only thing I don't like about that method is that changes to Opt() options are persistent, and as you write longer, more complicated scripts, that kind of thing gets to be painful to keep track of: "Why isn't is recognizing that window? Did I forget to switch WinTitleMatchMode back somewhere, again?"

Been there, done that.

Using the advanced specifications allows each reference to be self contained and independent of that kind of thing.

:mellow:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Posted

The only thing I don't like about that method is that changes to Opt() options are persistent, and as you write longer, more complicated scripts, that kind of thing gets to be painful to keep track of: "Why isn't is recognizing that window? Did I forget to switch WinTitleMatchMode back somewhere, again?"

Been there, done that.

Using the advanced specifications allows each reference to be self contained and independent of that kind of thing.

:mellow:

Ill take a look into that. Thank you. So far the Opt() is working for what I need at the moment but Ill take a look into it.

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
×
×
  • Create New...