← Back to team overview

sikuli-driver team mailing list archive

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:
Hi RaiMan,

What you have suggested will work for local file system. In my app, I am
accessing remote file system(remote machine). As I have shown you the
view of my app, the size column shows "-" for directory and file size in
bytes for files. How do I capture file size, as ctrl+c key doesn’t copy
file size. You might be surprised by my queries. Please suggest whatever
you feel. I will implement accordingly.

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: Tuesday, August 30, 2011 3:21 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:
If you need information on files just use the appropriate standard Python modules, that are available in Sikuli script.
Here is an example, that finds the most recently updated file in a directory.

more info: http://www.jython.org/docs/library/os.html

import os
dir = "absolute-path-to-your-folder"
files = os.listdir(dir)
latest = 0
file = ""
for f in files:
    full = os.path.join(dir, f)
    info = os.stat(full)
    t = time.strftime("%Y-%m-%d", time.localtime(info.st_ctime))
    if t > latest:
        latest = t
        file = full
print file, latest # here you have your file
import shutil
shutil.copy2( file , r"d:\newname" ) # incl timestamps

--- your OCR solution
if you want to read text from the screen, you first should make a test, wether this works reliable for your font.
print selectRegion().text() # run and select the appropriate region on screen

if you decide to use the OCR feature: the easiest way is to calculate the region, that contains the text and then say
text = reg.text()

the region should have a margin of about 2 pixels around the text.

there are many options to get the region. one option always is to
calculate/measure offsets to known visual objects already found.

-- 
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=6

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.