[1.1.0] App.focus() with non-ASCII characters in window title --- not possible

Asked by guto

Guys,

I've read all about the ASCII conversion problems and I have not found a solution for my question. I want to get focus on a page that has a special character like the code below:

openApp(r'C:\Program Files\Internet Explorer\iexplore.exe "http://cgj-jboss.tjsc.jus.br:8080/casan/"')
myApp = "Corregedoria-Geral da Justiça de Santa Catarina - Internet Explorer"
App.focus(myApp)

I got this error message: [error] App.focus failed: Corregedoria-Geral da Justiça de Santa Catarina - Internet Explorer not found

I know that is a problem with the special character ç (ALT+135), but I'm unable to solve it..
(sorry for my poor english)

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
RaiMan Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

You might try

myApp = u'Corregedoria-Geral da Justiça de Santa Catarina - Internet Explorer'

Revision history for this message
Best RaiMan (raimund-hocke) said :
#2

I just tested:
Window titles containing multi-byte characters like unicode/utf-8 are not found and hence not focused.
This will only be possible later with version 2, where utf-8 support will be a focus.

So in your case currently 2 possibilities:

--1:
App.focus("Corregedoria-Geral da Justi") # some part of the title

--2:
with the latest build of 1.1.0 you can do this:

ie = App.open(r'"C:\Program Files\Internet Explorer\iexplore.exe" "http://cgj-jboss.tjsc.jus.br:8080/casan/")
# some time later
ie.focus()

which will bring back the frontmost IExplorer window to front.
so no need to fiddle around with window titles.

Revision history for this message
guto (gmsetta) said :
#3

Thanks RaiMan, that solved my question.