Hi,
I want to open a picture with a program called Honeyview, once the picture is opened, this is the window name in Window spy : "accessories
> picture1.jpg [1/3] - Honeyview 5.40"
I don't know how to use that name for WinTitle. It doesn't work as it is (it says there are characters it doesn't recognize, whether i correct them or ignore, it doesn't work), putting the name between ''' doesn't work either.
I can't use ahk_class or _exe either since there can be other windows opened with the same program at the same time.
What do i do in this case?
Thank you.
Complicated Wintitle not recognized Topic is solved
Re: Complicated Wintitle not recognized Topic is solved
Haven't tried this, but according to the docs, if you put
before your use of a Wintitle, it will match a string anywhere within the title, so you could just match against "Honeyview"
Russ
Code: Select all
SetTitleMatchMode, 2
Russ
Re: Complicated Wintitle not recognized
You don’t have to use the entire title. You can use the start of the title (or another part using the approach RussF mentioned) and you can combine it with the ahk_class and/or ahk_exe to distinguish it from similarly named windows from other programs.
When you said “it says there are characters it doesn’t recognize,” what do you mean? An error message says that? Can you show the exact message?
Which command or function are you trying to use that WinTitle with? Please show what you tried. It seems like at least the attempt where it showed an error message would have been when it was used unquoted in a function parameter, which would have had it try to evaluate it as a variable name or expression, leading to the error. Putting quotes around it in that case should at least eliminate the error message.
When you said “it says there are characters it doesn’t recognize,” what do you mean? An error message says that? Can you show the exact message?
Which command or function are you trying to use that WinTitle with? Please show what you tried. It seems like at least the attempt where it showed an error message would have been when it was used unquoted in a function parameter, which would have had it try to evaluate it as a variable name or expression, leading to the error. Putting quotes around it in that case should at least eliminate the error message.
Last edited by boiler on 01 Dec 2021, 15:33, edited 1 time in total.
Re: Complicated Wintitle not recognized
I suggested SetTitleMatchMode since it looked like the beginning of the title could change with each picture whereas the "Honeyview" would probably be in every instance.
Russ
Russ
Re: Complicated Wintitle not recognized
You can use ahk_-rules, see WinTitle::Multiple criteriaKawaki wrote: ↑I want to open a picture with a program called Honeyview, once the picture is opened, this is the window name in Window spy : "accessories > picture1.jpg [1/3] - Honeyview 5.40"
I don't know how to use that name for WinTitle. It doesn't work as it is (it says there are characters it doesn't recognize, whether i correct them or ignore, it doesn't work), putting the name between ''' doesn't work either.
I can't use ahk_class or _exe either since there can be other windows opened with the same program at the same time.
There is an invisible special character (U+2029, paragraph separator) before > in Honeyview's title.
You can try one of the following methods, each will work for Honeyview with open image:
Code: Select all
SetTitleMatchMode, 2 ; Match substring anywhere inside the title
#IfWinActive - Honeyview ahk_class HoneyviewClassX ; Note that it looks for minus-space-Honeyview
SetTitleMatchMode, Regex ; Match using regular exressions
#IfWinActive ^(.+) .> (.+) (\[\d+\/\d+\]) - Honeyview ahk_class HoneyviewClassX ; Note dot before '>'. You still can use ahk_-rules with regex
Re: Complicated Wintitle not recognized
Seems to work. I just have to place it at the beginning of the code and it will work for any wintitle? Very convenient.RussF wrote: ↑01 Dec 2021, 15:26Haven't tried this, but according to the docs, if you putbefore your use of a Wintitle, it will match a string anywhere within the title, so you could just match against "Honeyview"Code: Select all
SetTitleMatchMode, 2
Russ
Re: Complicated Wintitle not recognized
mcl wrote: ...
Yeah, it's an error message. Apparently it comes from the language of my PC. I have PC in English but directories in French.boiler wrote: ...
I tried to encode with UTF-8 with BOM which resolved the issue of that specific error message but i still have those kind of issues.
Like if i try to open a file from Download (téléchargement in French) i have this :
Directory of file :
But what i see in directory bar in Explorer windows :
I'll open a new thread if i can't fix this.