← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #156266]: How to pass command line arguments to App?

 

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

    Status: Needs information => Answered

RaiMan proposed the following answer:
@ Calle:
nice try. Thank you :-) and please try to answer more questions in the future :-)
well analyzed, but your solution does not help, sorry.

@ Andrey:
--1. openApp() only works for applications and on Windows only .exe files can be accessed (e.g. no .bat or .cmd)

--2. openApp() does not allow any parameters for the application. the
parameter has to be the  the application name or the path to the
executable.

So what you want cannot be accomplished with Sikuli in the moment using
any App features.

try the following:
import os
os.popen("D:\\My_App.exe D:\\file_to_open.dae")
popup("app should be open now")

If the App or the parameter filename contain blanks, try this instead (outer single apostrophes and single backslash)
os.popen('"D:\My_App.exe" "D:\file_to_open.dae"')

the popup() is just to test, that the script continues after processing
the popen.

Another possible solution is to make an accordingly configured link e.g.
on the Desktop, that you just doubleclick to open your app with the
specified file.

In any case, you can use the functions of the App class to act on your
app later (e.g. App("My_app").close() supposing My_app shows up in one
window title of your app)

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