Pass parameter to openApp

Asked by Chetan

Hello
i would like to launch application acrobat.exe and mention the file name to open
i am able to do via command line and also via subprocess.Popen.
however it does not work with openApp
tried searching forum but no lock
below is the code

command line #works
"C:\\Program Files\\Adobe\\Acrobat Trunk\\Acrobat\\Acrobat.exe" C:\\Test.pdf

   path=r"C:\Program Files\Adobe\Acrobat Trunk\Acrobat\Acrobat.exe"
    #path="C:\\Program Files\\Adobe\\Acrobat Trunk\\Acrobat\\Acrobat.exe"
    file="C:\\test.pdf"

#works
    subprocess.Popen([path,file])

# Does NOT work
  openApp(path+file)

any pointers would be appreciated

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Best RaiMan (raimund-hocke) said :
#1

With 2.0.5 try this:

app = App(path)
app.setUsing(file)
app.open()

tested with notepad++

Revision history for this message
Chetan (cshamdas) said :
#2

Thanks RaiMan, that solved my question.

Revision history for this message
Chetan (cshamdas) said :
#3

Thanks Raiman like always.
below code solved it

    path1=r"C:\Program Files\Adobe\Acrobat Trunk\Acrobat\Acrobat.exe"

    file=r"C:\test.pdf"
    someApp = App(path1)
    someApp.setUsing(file)
    someApp.open()