← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #162994]: How to ?? :/

 

Question #162994 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/162994

    Status: Open => Answered

RaiMan proposed the following answer:
Sikuli motivates you to think in pictures and click's ;-)
... but in many cases solutions like this are much easier:

Since we can do things that are possible with Python, why not do it?

import os
dir = r"full-path-of-your-directory"
outName = dir+r"\dirlist.txt" # will contain the list of your filenames
files = os.listdir(dir) # read the filenames
out = file(outName, "w") # open outputfile
for f in files:
    # here you can inspect each filename
    out.write(f+"\n") # write each filename to one line
out.close()
type("r", KEY_WIN); wait(2) # Run dialog
paste(outName) # enter filename
type(Key.ENTER) # opens file in Notepad
switchApp("dirlist.txt") # brings Notepad window to front

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.