← Back to team overview

sikuli-driver team mailing list archive

[Question #689336]: Passing argument value dynamically

 

New question #689336 on Sikuli:
https://answers.launchpad.net/sikuli/+question/689336

Hi,

I want to pass the height and width value of my current monitor screen to the opened terminal dynamically. How i can achieve thi? I've tried few syntax, seems it's not working.
Below is my snippet-
cmdPath = os.getenv("comspec")
SCREEN=Screen(0)
print(showMonitors())
r=SCREEN.getRect()
w=r.width
print(w)
h=r.height
print(h)
title = "My Command Line"
cmd = 'start "%s" %s'%(title, cmdPath)
os.popen(cmd); 
wait(3)
type("mode con: cols=\"h\" lines=\"w\"")
type(Key.ENTER)
type("CD E:")
type(Key.ENTER)
type("CD E:\Pritam\SikuliXVer2.1.0-SNAPSHOT\DMO\ ")
type(Key.ENTER)
wait(1)
type("test.bat")
type(Key.ENTER)

type("mode con: cols=\"h\" lines=\"w\"")-----How i can pass the cols value and lines value dynamically as per h & w value? 
Sikuli version- 2.0.3
Java- jdk 1.8

Regards,
Cris


-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.