Sign in to follow this  
Followers 0
NeMoD

String into

5 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

[center]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.[/center]

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

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:

your welcome, glad i could help :geek:

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