Jump to content

String into


NeMoD
 Share

Recommended Posts

edit: I messed up the title of the post :ph34r:

Theres much more, but I'd post the only part that doesn't work

$Stringname = InputBox("Person's Name", "Put the username that displays in the chat window here", "")
Opt("WinTitleMatchMode", 1) 
WinActive ($Stringname)

I'm trying to make it able accept a persons name, then it activate the users chat window, since most chat programs have the username in the title.

But I the string doesn't work in WinActive? :lmao:

Edited by NeMoD
Link to comment
Share on other sites

That is because I highly doubt any chat program has ONLY the user name in the title... Try something like this :lmao:

$sWinName = InputBox("Chat", "Enter the user's name!")
$sWindows  = WinList()
For $i = 1 to $sWindows[0][0]
    if (StringInStr($sWindows[$i][0], $sWinName)) Then
           ;Put your code here: WinActivate($sWindows[$i][1])
    Else
    EndIf
Next
Edited by CHRIS95219
Link to comment
Share on other sites

  • Moderators

edit: I messed up the title of the post :ph34r:

Theres much more, but I'd post the only part that doesn't work

$Stringname = InputBox("Person's Name", "Put the username that displays in the chat window here", "")
Opt("WinTitleMatchMode", 1) 
WinActive ($Stringname)

I'm trying to make it able accept a persons name, then it activate the users chat window, since most chat programs have the username in the title.

But I the string doesn't work in WinActive? :lmao:

You'll find this more difficult than you think in IM applications... but I would do Opt('WinTitleMatchMode', 2) (1 is default btw, no need for an Opt). Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

You'll find this more difficult than you think in IM applications... but I would do Opt('WinTitleMatchMode', 2) (1 is default btw, no need for an Opt).

oh I thought 0 was default, maybe I misread, thanks for the replies I'll try it out now :lmao:

edit: thanks CHRIS95219 works perfectly :ph34r:

Edited by NeMoD
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...