sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #04930
Re: [Question #169023]: Currently running application title needed
Question #169023 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/169023
Status: Answered => Open
Vinay Kulkarni is still having a problem:
Ok. I have an application in which I am displaying my local file system
in collapse view (tree structure). There are 2 columns namely Name and
Size. View is like this:
Name | Size
+MyDir
-+SomeFile | 1024
I tried to copy file size by clicking on size column, it's not possible.
I am planning to move my cursor few to pixels right side from SomeFile,
then capture and then convert it to text. Is it possible? Please suggest
some idea.
Thanks & Regards,
Vinay Kulkarni
Ishnatek Systems & Services Pvt. Ltd.
Contact : +91 8956345939
-----Original Message-----
From: bounces@xxxxxxxxxxxxx [mailto:bounces@xxxxxxxxxxxxx] On Behalf Of RaiMan
Sent: Monday, August 29, 2011 1:11 PM
To: vinay@xxxxxxxxxxxx
Subject: Re: [Question #169023]: Currently running application title needed
Your question #169023 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/169023
Status: Open => Answered
RaiMan proposed the following answer:
This only works of course if you have a frontmost window, with a classic title bar like with Notepad.
And the window, you are targeting must have had the focus, before you switched to Sikuli IDE, to run the script.
this e.g. works for a Notepad window on my Win7:
win = App.focusedWindow()
titleBar = win.above(1).below(26) # select the titlebar
titleBarText = titleBar.left(1).right(26).right(titleBar.w-150) # narrow to text part
titleBarText.highlight(2)
print titleBarText.text()
The above solution, does not use drag/drop and does not touch the
cursor. It simply reads, what is visible on the screen.
--- you say: As we can close the app by its title
yes of course - but there you have to know at least part of the window title of the window, that you want to close.
--- you say: Shall I have to use any python or java function for that.
The App class is implemented on the Java level and furthermore depends on system specific (Windows, Mac, Linux) low level modules. You might have a look into the sources, to find out, how the internal access to the window title is realized e.g. for the close function. So you might find out how to code in Java, to get the window title of the frontmost window.
On the Python level (which is Jython actually), there is no feature available to access the Windows GUI.
--
If this answers your question, please go to the following page to let us
know that it is solved:
https://answers.launchpad.net/sikuli/+question/169023/+confirm?answer_id=4
If you still need help, you can reply to this email or go to the
following page to enter your feedback:
https://answers.launchpad.net/sikuli/+question/169023
You received this question notification because you asked the question.
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.