Reda_Nihilistic

equivalent of *

10 posts in this topic

hello, 

what is the equivalent of the star in autoit (to represent any string)

for exemple i want to open a window that start with 'rainbow', so can i do : WinSetState("rainbow *", "", @SW_MAXIMIZE)

thanks

Share this post


Link to post
Share on other sites

#2 ·  Posted (edited)

You can use the processlist function, and after the _arraysearch function to find your window

Edited by ATR

Share this post


Link to post
Share on other sites

thanks ATR, but I'm beginner and your solution seems very complicated :blink:

Share this post


Link to post
Share on other sites

Synapsee

yes that's work thanks, and how about if 'rainbow' was in the end of title, i mean can we call a window just by using a party of his name

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

u need use that page : https://www.autoitscript.com/autoit3/docs/intro/windowsadvanced.htm

like this : https://www.autoitscript.com/autoit3/docs/functions/AutoItSetOption.htm#WinTitleMatchMode

Opt("WinTitleMatchMode", 1) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase

That style it's possible too (i see that on a melba post somewhere) :

;is the default option
;Opt("WinTitleMatchMode", 1) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase

;use subStr Mode
Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase

;Add your stuff

;return too default mode
Opt("WinTitleMatchMode", 1) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase

;Other stuff

 

Edited by Synapsee

Share this post


Link to post
Share on other sites

I find

Opt ("WinTitleMatchMode", -2)

to be very forgiving, if applicable.

_aleph_


Meds.  They're not just for breakfast anymore. :'(

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

A good time to learn some simple RegEx

https://www.autoitscript.com/autoit3/docs/intro/windowsadvanced.htm

 

Match mode is an easy fix, but a bit more shotgun where it will match anywhere, some easy regex can let you specify the start of the string and a lot more should you need to tweak it later on.  Plus you wont have to change your match mode for all other windows if you only need it for this particular one. 

 

WinSetState("[REGEXPTITLE:(?i)^rainbow.*]", "", @SW_MAXIMIZE)

 

https://regex101.com/r/sB3wJ9/1

Edited by ViciousXUSMC
1 person likes this

Share this post


Link to post
Share on other sites
Quote

Match mode is an easy fix, but a bit more shotgun where it will match anywhere, some easy regex can let you specify the start of the string and a lot more should you need to tweak it later on.  Plus you wont have to change your match mode for all other windows if you only need it for this particular one.

well spotted

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